redux-generate-actions
v0.0.1
Published
Downloads
1
Readme
redux-generate-actions
generate actions object with a prefix
import reduxGenerateActions from 'redux-generate-actions';
const actions = reduxGenerateActions('TODO', [
'ADD_TODO',
'TOGGLE_TODO',
'SET_VISIBILITY_FILTER',
])
// will produce:
{
ADD_TODO: 'TODO/ADD_TODO',
TOGGLE_TODO: 'TODO/TOGGLE_TODO',
SET_VISIBILITY_FILTER: 'TODO/SET_VISIBILITY_FILTER',
}
Real world example
actions.js
import reduxGenerateActions from 'redux-generate-actions';
const actions = reduxGenerateActions('', [
'ADD_TODO',
'TOGGLE_TODO',
'SET_VISIBILITY_FILTER',
])
export default actions;