create flux ActionTypes less verbose
$ npm install --save create-action-types
import create from 'create-action-types';
export default create([
'INCREMENT_COUNTER',
'DECREMENT_COUNTER',
// ..other action types
]);
// =>
// {
// INCREMENT_COUNTER: 'INCREMENT_COUNTER',
// DECREMENT_COUNTER: 'DECREMENT_COUNTER'
// }
is more clear than:
import keyMirror from 'keymirror';
export default keyMirror({
INCREMENT_COUNTER: null,
DECREMENT_COUNTER: null,
// ..other action types
});
MIT © C.T. Lin