- Notifications
You must be signed in to change notification settings - Fork294
Flux Standard Action utilities for Redux.
License
NotificationsYou must be signed in to change notification settings
redux-utilities/redux-actions
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Flux Standard Action utilities for Redux
$ npm install --save redux-actions
or
$ yarn add redux-actions
Thenpm package providesES modules that should be compatible with every modern build tooling.
import{createActions,handleActions,combineActions}from'redux-actions';constdefaultState={counter:10};const{ increment, decrement}=createActions({INCREMENT:(amount=1)=>({ amount}),DECREMENT:(amount=1)=>({amount:-amount})});constreducer=handleActions({[combineActions(increment,decrement)]:(state,{payload:{ amount}})=>{return{ ...state,counter:state.counter+amount};}},defaultState);exportdefaultreducer;
About
Flux Standard Action utilities for Redux.
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
No packages published