Redux store utility
A utility to simplify creation of Redux store by creating
- Action constants
- Actions,
- Async actions
- Reducer
Installation
npm install redux-store-utility
Documentation
Create Redux store for "PRODUCTS" as follows
store.js
;;;; const store = ; ;
rootReducer.js
;; const pr = reduxStoreUtility const app = ; ;
initialState.json
To get synchronous actions
; const syncActions = reduxStoreUtility;
It will create following actions
- product Reset
- product Pending
- product Success
- product Error
For fetching (async action) from api and putting in "PRODUCTS" store use as follows
; const asyncActions = reduxStoreUtility; const request = 'http://localhost:3002/' method: 'GET' headers: 'Accept': 'application/json' ; const productsFetch = ;