Skip to content

chentsulin/create-action-types

Repository files navigation

create-action-types

NPM version Build Status Test coverage Dependency Status

create flux ActionTypes less verbose

Install

$ npm install --save create-action-types

Usage

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
});

License

MIT © C.T. Lin