npm install zp-bus --save
yarn add zp-bus
import { EventBus } from 'zp-bus'
const bus = new EventBus()
// 注册集合处理器
function test_handler(e, context) {
console.log(e.type) // test/a
console.log(e.value) // 1
}
bus.registerCollectionHandler('test', test_handler)
bus.dispatch({
type : 'test/a',
value : 1
})