I am using react with Flux architecture.
I've read on the web that in order to define Store, I have to do something like that:
var AppDispatcher = require('../dispatcher/dispatcher'), //facebook's dispatcher
EventEmitter = require('events').EventEmitter,
assign = require('object-assign');
var MyStore = assign({}, EventEmitter.prototype, {
.....
As far as I understand, EventEmitter and facebook's dispatcher has a lot in common. For example, the both can emit (or dispatch) an event.
My question is why do I need both EventEmitter and dispatcher? Isn't it redundant?
Isn't it better to create a dispatcher that includes also the EventEmitter needed behavior?