Skip to content

Commit ccb3f2f

Browse files
committed
Fix lodash imports and linting
1 parent 778803e commit ccb3f2f

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

src/instrument.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {difference} from 'lodash/array';
1+
import difference from 'lodash/difference';
22

33
export const ActionTypes = {
44
PERFORM_ACTION: 'PERFORM_ACTION',
@@ -344,7 +344,7 @@ export default function instrument(monitorReducer = () => null) {
344344

345345
function liftReducer(r) {
346346
if (typeof r !== 'function') {
347-
if (r && typeof r['default'] === 'function') {
347+
if (r && typeof r.default === 'function') {
348348
throw new Error(
349349
'Expected the reducer to be a function. ' +
350350
'Instead got an object with a "default" field. ' +

src/persistState.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import {mapValues} from 'lodash/object';
2-
import {identity} from 'lodash/utility';
1+
import mapValues from 'lodash/mapValues';
2+
import identity from 'lodash/identity';
33

44
export default function persistState(sessionId, deserializeState = identity, deserializeAction = identity) {
55
if (!sessionId) {

test/instrument.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ describe('instrument', () => {
339339

340340
it('warns if the reducer is not a function but has a default field that is', () => {
341341
expect(() =>
342-
createStore(({ default: () => {} }), instrument())
342+
createStore(({ 'default': () => {} }), instrument())
343343
).toThrow(
344344
'Expected the reducer to be a function. ' +
345345
'Instead got an object with a "default" field. ' +
@@ -350,7 +350,7 @@ describe('instrument', () => {
350350

351351
it('throws if there are more than one instrument enhancer included', () => {
352352
expect(() => {
353-
createStore(counter, compose(instrument(), instrument()))
353+
createStore(counter, compose(instrument(), instrument()));
354354
}).toThrow(
355355
'DevTools instrumentation should not be applied more than once. ' +
356356
'Check your store configuration.'

test/persistState.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ describe('persistState', () => {
9191
it('should warn if read from localStorage fails', () => {
9292
const spy = expect.spyOn(console, 'warn');
9393
delete global.localStorage.getItem;
94-
const store = createStore(reducer, compose(instrument(), persistState('id')));
94+
createStore(reducer, compose(instrument(), persistState('id')));
9595

9696
expect(spy.calls).toContain(
9797
/Could not read debug session from localStorage/,

0 commit comments

Comments
 (0)