xcraft-reflux
Version:
A simple library for uni-directional dataflow application architecture inspired by ReactJS Flux
24 lines (19 loc) • 508 B
JavaScript
var Reflux = require('../../src'),
action = Reflux.createAction(),
store,
i,
noop = function() {},
NUMBER_OF_LISTENERS = 100;
store = Reflux.createStore({
init: function() {
this.listenTo(action, this.trigger);
}
});
// noops are listening to the store to emit
for (i = 0; i < NUMBER_OF_LISTENERS; i++) {
store.listen(noop);
}
exports.name = "Listening to stores with " + NUMBER_OF_LISTENERS + " listeners";
exports.fn = function() {
action(Math.random());
};