Process changes in redux with path matching.
- easier to reduce data that depends on multiple values in the redux store
- reduce only when changes occur, no needless calculations
- processes all changes within the same reduction preventing breaks normally caused by side effects pattern
- cleanly decouple reductions based on data that may be affected by multiple actions
- no need to replicate reductions in several action reducers
npm install --save redux-changes
;;const handler =;const store =
Creates a reducer that runs if a change is detected in the state at the given path pattern.
Creates multiple reducers using
handleChange() and combines them into a single handler that handles multiple changes. Accepts a map where the keys are passed as the first parameter to
handleChange() (the change path), and the values are passed as the second parameter as the handler.
handleChanges() works by applying multiple reducers in sequence using reduce-reducers.)
;;const reducer =;const handler =;const store =