Flux Standard Action type generator for Redux.
The npm package provides a CommonJS build for use in Node.js, and with bundlers like Webpack and Browserify. It also includes an ES modules build that works well with Rollup and Webpack2's tree-shaking.
npm install --save redux-actions-generator
or
yarn add redux-actions-generator
import createActions from 'redux-actions-generator';
const actions = createActions(
'TODO',
[
'ADD_TODO',
'TOGGLE_TODO',
'SET_VISIBILITY_FILTER',
]
)
expect(actions).to.deep.equal({
ADD_TODO: 'TODO/ADD_TODO',
TOGGLE_TODO: 'TODO/TOGGLE_TODO',
SET_VISIBILITY_FILTER: 'TODO/SET_VISIBILITY_FILTER',
});
import createActions from 'redux-actions-generator';
const actions = createActions('', [
'ADD_TODO',
'TOGGLE_TODO',
'SET_VISIBILITY_FILTER',
])
export default actions;