fluxxor
fluxxor copied to clipboard
Export Store
I changed to export the lib/store
module. By using this directly, we will be able to create stores by using ES6 Classes style.
For example in TypeScript:
import Fluxxor = require('fluxxor');
interface MyStoreOption {
value: number;
}
class MyStore extends Fluxxor.Store {
options: MyStoreOption;
constructor(options: MyStoreOption) {
super();
this.options = options;
this.bindActions("ACTION_TYPE", this.handleActionType.bind(this));
}
handleActionType(payload: number) {
// ...
}
}
var myStore = new MyStore({value: 123});
In addition, this style is compatible with static typing languages such as TypeScript.