tDispatcher
Flux-Dispatcher, with common API for huge applications
So this project is for guys who are interested to use Flux and do it in a simple way, that might be familiar with other eventsystems.
I developed this framework, because I am up to start a new Project, with a lot of complex dataflows between client- and server-application.
My decision was already done, to use react. As I am familiar with Backbone and some other frameworks, I thought, how that could integrate with React. Many people use React together with Backbone and replace the views with React. I found, that the standart dispatcher in the Flux-Tutorial has many similarities with Backbone.event or my tMitter. So I changed the tMitter, to hit the queried behaviour as mention at the Flux Website.
Description
This is an Event-system, where events are representing actions and listener can define other listener to be executed first.
It will execute one action on all corresponding callbacks, before computing the next action, that might be triggered by a callback.
It is possible for an listener to require that one or more Other listener have to be executed before. can also be used as middlewhere, to manipulate the action
As soon as all actions are computed, it will trigger an 'dispatched' event, to let views re-render the updated Data in the stores.
API
All you need are three methods, maybe just two of them: on, off and trigger.
1. tDispatcher.on();
{ event:'theEventname',
name:'nameThatCanBeRequired',
callback:function(){'toBeExecuted'},
require:['module that is required']
}
2. tDispatcher.off;
.off(event)
.off(event, name)
.off(event,callback)
3. tDispatcher.trigger()
4. tDispatcher.addAction(name)
##Developer
Tobias Nickel