UNPKG

redux-state-utils

Version:

Library to help the creation of states in redux

15 lines (12 loc) 411 B
import createStateProxy from './state-proxy'; const reducerStateProxy = (reducer) => { return (state, action) => { if (action.type.substr(0, 2) === '@@') { return reducer(state, action); } const stateProxy = createStateProxy(state); reducer(stateProxy, action); return stateProxy.getNewState(); } }; export default reducerStateProxy;