redux-fast-actions
v0.1.0
Published
A module to ease the pain of creating actions constants and action creator functions.
Downloads
2
Readme
Why?
Because declaring action constants and action creator function for each action is a real pain.
One object to rule them all
Create an action config object.
import fastActions from 'redux-fast-actions';
const = actions = {
home: {
fetchFeed: { payload: ['feeds'] },
}
}
fastActions(actions);
Redux Fast Actions generates actions constants and action creators.
{
types:{
HOME_FETCH_FEED: 'HOME_FETCH_FEED'
},
actions: {
home: {
fetchFeed: (feeds) => {
return { type: HOME_FETCH_FEED, payload: { feeds } }
}
}
}
}
Installation
npm i redux-fast-actions --save
or if you prefer yarn:
yarn add redux-fast-actions