0.0.3 • Published 10 years ago

react-idispatcher v0.0.3

Weekly downloads
3
License
MIT
Repository
github
Last release
10 years ago

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