Redux Identity
Super tiny redux identity reducer for persisting a slice of state after updates.
Installation
npm install --save redux-identity
yarn add redux-identity
API
IdentityReducer(initialState)
IdentityReducer :: a -> a -> a
- parameter: initial state of reducer
- return: a reducer which when invoked by redux will return the given slice of state or the initial reducer state if no slice exists
Usage
Reducer only initial state
No initial state is supplied to the createStore
function
;; ;; const reducers = ; let store = ; store
Redux Store Initial State
Initial state of the identity reducer is overridden and then persisted by the corresponding slice of the state object provided to the createStore
function
;; ;; const reducers = ; let store = ; store
License
MIT