Yet another Flux store for both client- and server-side.
Installation
Node.js
npm install fluxstore
Bower
bower install fluxstore
Usage
var FluxStore = ; // Node.js. For browser script tag: include file from the dist/ folder. // Init FluxStore with the dispatcher. It returns Store constructor.var dispatcher = 'flux';var Store = ; // Create a new store with optional initial statevar store = foo: 'bar'; // Add a reducer. Reducer is a function that will be invoked on specified// action. It's always invoked with the current state of the store and// the action that triggered it. If you return a non-falsy value from// the reducer it will be treated as a new state. This will cause in// state change and triggering a change event.store; // Listen for change eventstore; { ;}; // To trigger the reducer invoke dispatch with actionName matching reducer's namedispatcher; // Stop listening for changesstore;
More info in API Docs.