1.0.2 • Published 8 years ago

@nolanrigo/make-action-creator v1.0.2

Weekly downloads
-
License
WTFPL
Repository
github
Last release
8 years ago

make-action-creator

npm version downloads travis wtfpl license

Generate an redux action creator, totally inspired by example gives in Redux documentation

Installation

$ npm i -S @nolanrigo/make-action-creator

Use it

// src/actions.js
import makeActionCreator from '@nolanrigo/make-action-creator';

export const SOME_ACTION = 'SOME_ACTION';

export const someAction = makeActionCreator(SOME_ACTION, 'param');
import { someAction } from './src/actions';

console.log(someAction('value'));
/*
Result:
{
  type: 'SOME_ACTION',
  payload: {
    param: 'value',
  },
}
*/

License

Guy, Do What the Fuck You Want to

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago