first argument must be fn or undefined

This commit is contained in:
echenley 2016-02-04 14:05:50 -06:00
parent 0facdbbc9f
commit f0e1efdcc2
2 changed files with 2 additions and 4 deletions

View File

@ -347,9 +347,7 @@ function unliftStore(liftedStore, liftReducer) {
/** /**
* Redux instrumentation store enhancer. * Redux instrumentation store enhancer.
*/ */
export default function instrument(monitorReducer, options = {}) { export default function instrument(monitorReducer = () => null, options = {}) {
if (!monitorReducer) { monitorReducer = () => null; }
return createStore => (reducer, initialState, enhancer) => { return createStore => (reducer, initialState, enhancer) => {
function liftReducer(r) { function liftReducer(r) {

View File

@ -300,7 +300,7 @@ describe('instrument', () => {
let configuredLiftedStore; let configuredLiftedStore;
beforeEach(() => { beforeEach(() => {
configuredStore = createStore(counter, instrument(null, { maxAge: 2 })); configuredStore = createStore(counter, instrument(undefined, { maxAge: 2 }));
configuredLiftedStore = configuredStore.liftedStore; configuredLiftedStore = configuredStore.liftedStore;
}); });