Syntagme is a flux's flamework.
bower install --save syntagme
npm install --save syntagme
const app =appappappappappaction'INCREMENT'console // 2
Promise on ActionCreator
const app =appappappappappaction'FETCH' type: 'greeting'
Subscribe to state and start executing dispatcher. If dispatch is executed before listen, it gets an error.
app.subscribe(listener: (state) => void)
Subscribe to store updates.
listener is executed when state is updated.
app.reducer(reducer: (payload, state) => (state | null))
Register the reducer. Reducers are executed in the order in which they are registered.
If you do not return the new state, subscribe will not be executed.
app.actionCreator(type: ActionType, actionCreator: () => Promise | null)
Register the ActionCreator. Dispatch the evaluation result of the specified function as Action.
When returning Promise,
_RESOLVE when resolving, and
_REJECT when rejecting are combined with type and dispatched.
app.action(type: ActionType, args)
Dispatch the ActionCreator registered based on type.
An error occurs if you specify an unregistered ActionType.