brat-frontend-editor
Version:
"BRAT Editor standalone frontend library"
15 lines (11 loc) • 341 B
JavaScript
import { combineReducers } from 'redux'
export const makeRootReducer = (asyncReducers) => {
return combineReducers({
...asyncReducers
})
}
export const injectReducer = (store, { key, reducer }) => {
store.asyncReducers[key] = reducer
store.replaceReducer(makeRootReducer(store.asyncReducers))
}
export default makeRootReducer