zp-event

1.0.2 • Public • Published

知乎招聘消息总线

安装

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
})

Dependencies (0)

    Dev Dependencies (17)

    Package Sidebar

    Install

    npm i zp-event

    Weekly Downloads

    0

    Version

    1.0.2

    License

    ISC

    Unpacked Size

    38.9 kB

    Total Files

    21

    Last publish

    Collaborators

    • skybjf