bell-tree-flux
v1.0.3
Published
Simple flux library.
Downloads
3
Readme
bell-tree-flux
Abstract
Simple flux library.
- sample project https://github.com/jsuzuki20120311/bell-tree-flux-sample
- demo https://www.belltree.tokyo/bell-tree-flux-sample/
install
$ npm install bell-tree-flux --save
import
require
var BellTreeFlux = require('bell-tree-flux').default;
ES2015 import
import BellTreeFlux from 'bell-tree-flux';
How to use
setStore
var BellTreeFlux = require('bell-tree-flux').default;
var store = {
emit: function () {
// do something
}
};
BellTreeFlux.Dispatcher.getDispatcher().setStore(store);
register
// arg1: actionName , arg2: event handler callback function
BellTreeFlux.Dispatcher.getDispatcher().register(Constant.ACTION_TYPE.UPDATE_TODO, this.onUpdate);
remove
// arg1: actionName , arg2: event handler callback function
BellTreeFlux.Dispatcher.getDispatcher().remove(Constant.ACTION_TYPE.UPDATE_TODO, this.onUpdate);
License
MIT