Throw if the reducer passed to replaceReducer() is not a function

This commit is contained in:
Mihail Diordiev 2016-01-30 15:11:54 +02:00
parent a370d49eec
commit d756384b6c

View File

@ -336,6 +336,9 @@ function unliftStore(liftedStore, liftReducer) {
export default function instrument(monitorReducer = () => null) {
return createStore => (reducer, initialState, enhancer) => {
function liftReducer(r) {
if (typeof r !== 'function') {
throw new Error('Expected the nextReducer to be a function.')
}
return liftReducerWith(r, initialState, monitorReducer);
}