A machine-friendly (ReactMob-friendly) standard for Flux objects. Feedback welcome.
See https://github.com/acdlite/flux-standard-action
And for ReactMob we like to define meaningful semantic to use across component
and middleware
.
- Semantic. RMFS should be meaningful or describe their intent.
- Simple. RMFS should be simple, straightforward, and MUST to use
FSA.meta
in action.
RMFS's lib do nothing in production
just check in dev
.
ReactMob Flux Standard Action:
{
type: 'ADD_TODO',
payload: {
text: 'Do something.'
},
meta: {
show_loading_indicator: true
}
}
TODO
export const showLoadingIndicatorMiddleware = store => next => action => {
switch (action.meta['show_loading_indicator']) {
store.dispatch('somr action');
// or
actionSubscribers.reduce(store.dispatch)
}
next(action);
}