mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2025-01-31 19:54:35 +03:00
Fix lodash imports and linting
This commit is contained in:
parent
778803eb97
commit
ccb3f2f070
|
@ -1,4 +1,4 @@
|
||||||
import {difference} from 'lodash/array';
|
import difference from 'lodash/difference';
|
||||||
|
|
||||||
export const ActionTypes = {
|
export const ActionTypes = {
|
||||||
PERFORM_ACTION: 'PERFORM_ACTION',
|
PERFORM_ACTION: 'PERFORM_ACTION',
|
||||||
|
@ -344,7 +344,7 @@ export default function instrument(monitorReducer = () => null) {
|
||||||
|
|
||||||
function liftReducer(r) {
|
function liftReducer(r) {
|
||||||
if (typeof r !== 'function') {
|
if (typeof r !== 'function') {
|
||||||
if (r && typeof r['default'] === 'function') {
|
if (r && typeof r.default === 'function') {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
'Expected the reducer to be a function. ' +
|
'Expected the reducer to be a function. ' +
|
||||||
'Instead got an object with a "default" field. ' +
|
'Instead got an object with a "default" field. ' +
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import {mapValues} from 'lodash/object';
|
import mapValues from 'lodash/mapValues';
|
||||||
import {identity} from 'lodash/utility';
|
import identity from 'lodash/identity';
|
||||||
|
|
||||||
export default function persistState(sessionId, deserializeState = identity, deserializeAction = identity) {
|
export default function persistState(sessionId, deserializeState = identity, deserializeAction = identity) {
|
||||||
if (!sessionId) {
|
if (!sessionId) {
|
||||||
|
|
|
@ -339,7 +339,7 @@ describe('instrument', () => {
|
||||||
|
|
||||||
it('warns if the reducer is not a function but has a default field that is', () => {
|
it('warns if the reducer is not a function but has a default field that is', () => {
|
||||||
expect(() =>
|
expect(() =>
|
||||||
createStore(({ default: () => {} }), instrument())
|
createStore(({ 'default': () => {} }), instrument())
|
||||||
).toThrow(
|
).toThrow(
|
||||||
'Expected the reducer to be a function. ' +
|
'Expected the reducer to be a function. ' +
|
||||||
'Instead got an object with a "default" field. ' +
|
'Instead got an object with a "default" field. ' +
|
||||||
|
@ -350,7 +350,7 @@ describe('instrument', () => {
|
||||||
|
|
||||||
it('throws if there are more than one instrument enhancer included', () => {
|
it('throws if there are more than one instrument enhancer included', () => {
|
||||||
expect(() => {
|
expect(() => {
|
||||||
createStore(counter, compose(instrument(), instrument()))
|
createStore(counter, compose(instrument(), instrument()));
|
||||||
}).toThrow(
|
}).toThrow(
|
||||||
'DevTools instrumentation should not be applied more than once. ' +
|
'DevTools instrumentation should not be applied more than once. ' +
|
||||||
'Check your store configuration.'
|
'Check your store configuration.'
|
||||||
|
|
|
@ -91,7 +91,7 @@ describe('persistState', () => {
|
||||||
it('should warn if read from localStorage fails', () => {
|
it('should warn if read from localStorage fails', () => {
|
||||||
const spy = expect.spyOn(console, 'warn');
|
const spy = expect.spyOn(console, 'warn');
|
||||||
delete global.localStorage.getItem;
|
delete global.localStorage.getItem;
|
||||||
const store = createStore(reducer, compose(instrument(), persistState('id')));
|
createStore(reducer, compose(instrument(), persistState('id')));
|
||||||
|
|
||||||
expect(spy.calls).toContain(
|
expect(spy.calls).toContain(
|
||||||
/Could not read debug session from localStorage/,
|
/Could not read debug session from localStorage/,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user