* Replaces the reducer currently used by the store to calculate the state. * * You might need this if your app implements code splitting and you want to * load some of the reducers dynamically. You might also need this if you * implement a hot reloading mechanism for Redux. * * @pa
(nextReducer)
| 21609 | * @returns {void} |
| 21610 | */ |
| 21611 | function replaceReducer(nextReducer) { |
| 21612 | if (typeof nextReducer !== 'function') { |
| 21613 | throw new Error('Expected the nextReducer to be a function.'); |
| 21614 | } |
| 21615 | |
| 21616 | currentReducer = nextReducer; |
| 21617 | dispatch({ type: ActionTypes.INIT }); |
| 21618 | } |
| 21619 | |
| 21620 | /** |
| 21621 | * Interoperability point for observable/reactive libraries. |
nothing calls this directly
no test coverage detected