react-idispatcher

0.0.3 • Public • Published

React Improved Dispatcher

An improved event dispatcher allow listeners to listen to specific events and actions or to global events. You can register three ways:

//all global events
dispatcher.register(function(e) {
    //e.payload
});

//all foo events
dispatcher.register('foo', function(e) {
    //e.payload
});

//any foo event with create action
dispatcher.register('foo', 'create', function(e) {
    //e.payload
});

To dispatch an event, you can dispatch via:

dispatcher.dispatch('foo', 'create', {
    bar : 'baz'
});

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.3
    4
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.3
    4
  • 0.0.2
    0
  • 0.0.1
    0

Package Sidebar

Install

npm i react-idispatcher

Weekly Downloads

4

Version

0.0.3

License

MIT

Last publish

Collaborators

  • mitchellsimoens-user