From f0e1efdcc225c30471360de2d393edf22e6253f8 Mon Sep 17 00:00:00 2001 From: echenley Date: Thu, 4 Feb 2016 14:05:50 -0600 Subject: [PATCH] first argument must be fn or undefined --- src/instrument.js | 4 +--- test/instrument.spec.js | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/instrument.js b/src/instrument.js index d12d998a..d4cb4303 100644 --- a/src/instrument.js +++ b/src/instrument.js @@ -347,9 +347,7 @@ function unliftStore(liftedStore, liftReducer) { /** * Redux instrumentation store enhancer. */ -export default function instrument(monitorReducer, options = {}) { - if (!monitorReducer) { monitorReducer = () => null; } - +export default function instrument(monitorReducer = () => null, options = {}) { return createStore => (reducer, initialState, enhancer) => { function liftReducer(r) { diff --git a/test/instrument.spec.js b/test/instrument.spec.js index b3083438..00c2342b 100644 --- a/test/instrument.spec.js +++ b/test/instrument.spec.js @@ -300,7 +300,7 @@ describe('instrument', () => { let configuredLiftedStore; beforeEach(() => { - configuredStore = createStore(counter, instrument(null, { maxAge: 2 })); + configuredStore = createStore(counter, instrument(undefined, { maxAge: 2 })); configuredLiftedStore = configuredStore.liftedStore; });