create-action-types
Version:
create flux ActionTypes less verbose
63 lines (43 loc) • 1.44 kB
Markdown
[![NPM version][npm-image]][npm-url]
[![Build Status][travis-image]][travis-url]
[![Test coverage][coveralls-image]][coveralls-url]
[![Dependency Status][david_img]][david_site]
> create flux ActionTypes less verbose
```
$ npm install --save create-action-types
```
```js
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:
```js
import keyMirror from 'keymirror';
export default keyMirror({
INCREMENT_COUNTER: null,
DECREMENT_COUNTER: null,
// ..other action types
});
```
MIT © [C.T. Lin](http://github.com/chentsulin/create-action-types)
[]: https://img.shields.io/npm/v/create-action-types.svg?style=flat-square
[]: https://npmjs.org/package/create-action-types
[]: https://travis-ci.org/chentsulin/create-action-types.svg
[]: https://travis-ci.org/chentsulin/create-action-types
[]: https://img.shields.io/coveralls/chentsulin/create-action-types.svg?style=flat-square
[]: https://coveralls.io/r/chentsulin/create-action-types
[]: https://img.shields.io/david/chentsulin/create-action-types.svg
[]: https://david-dm.org/chentsulin/create-action-types