Custom reducers
Breezy generators will yarn add reduce-reducers
and set up a reducers.js
. If you find yourself needing additional functionality beyond what the generated reducers provide, just add your own reducers:
....
import reduceReducers from 'reduce-reducers'
import {getIn} from '@jho406/breezy'
import produce from "immer"
function myCustomReducer(state = {}, action) {
....
}
...
const store = createStore(
combineReducers({
breezy: breezyReducer,
pages: reduceReducers(pagesReducer, applicationReducer),
additionalFoobar: myCustomReducer
}),
initialState,
applyMiddleware(thunk)
)
Last updated
Was this helpful?