@redux-devtools/instrument
Advanced tools
Comparing version 1.11.0 to 1.11.1
@@ -65,3 +65,3 @@ import { Action, PreloadedState, Reducer, Store, StoreEnhancer } from 'redux'; | ||
preloadedState?: S; | ||
noRecompute: boolean | undefined; | ||
noRecompute?: boolean | undefined; | ||
} | ||
@@ -68,0 +68,0 @@ interface LockChangesAction { |
{ | ||
"name": "@redux-devtools/instrument", | ||
"version": "1.11.0", | ||
"version": "1.11.1", | ||
"description": "Redux DevTools instrumentation", | ||
@@ -30,3 +30,3 @@ "keywords": [ | ||
"scripts": { | ||
"build": "npm run build:types && npm run build:js", | ||
"build": "yarn run build:types && yarn run build:js", | ||
"build:types": "tsc --emitDeclarationOnly", | ||
@@ -37,17 +37,28 @@ "build:js": "babel src --out-dir lib --extensions \".ts\" --source-maps inline", | ||
"lint": "eslint . --ext .ts", | ||
"lint:fix": "eslint . --ext .ts --fix", | ||
"type-check": "tsc --noEmit", | ||
"type-check:watch": "npm run type-check -- --watch", | ||
"preversion": "npm run type-check && npm run lint && npm run test", | ||
"prepublishOnly": "npm run clean && npm run build" | ||
"prepack": "yarn run clean && yarn run build", | ||
"prepublish": "yarn run type-check && yarn run lint && yarn run test" | ||
}, | ||
"dependencies": { | ||
"lodash": "^4.17.19", | ||
"symbol-observable": "^2.0.3" | ||
"lodash": "^4.17.21" | ||
}, | ||
"devDependencies": { | ||
"@types/lodash": "^4.14.159", | ||
"jest": "^26.2.2", | ||
"redux": "^4.0.5", | ||
"rxjs": "^6.6.2" | ||
"@babel/cli": "^7.16.0", | ||
"@babel/core": "^7.16.0", | ||
"@babel/preset-env": "^7.16.0", | ||
"@babel/preset-typescript": "^7.16.0", | ||
"@types/jest": "^27.0.2", | ||
"@types/lodash": "^4.14.176", | ||
"@types/node": "^16.11.6", | ||
"@typescript-eslint/eslint-plugin": "^5.2.0", | ||
"@typescript-eslint/parser": "^5.2.0", | ||
"eslint": "^7.32.0", | ||
"eslint-config-prettier": "^8.3.0", | ||
"eslint-plugin-jest": "^25.2.2", | ||
"jest": "^27.3.1", | ||
"redux": "^4.1.2", | ||
"rimraf": "^3.0.2", | ||
"rxjs": "^7.4.0", | ||
"ts-jest": "^27.0.7", | ||
"typescript": "~4.4.4" | ||
}, | ||
@@ -57,3 +68,3 @@ "peerDependencies": { | ||
}, | ||
"gitHead": "5ef9b00cd4717ac878068ce8003e1999e680c72e" | ||
"gitHead": "faff0db47b6d7ed0d1fd708d9264a6069f65e4ff" | ||
} |
import difference from 'lodash/difference'; | ||
import union from 'lodash/union'; | ||
import isPlainObject from 'lodash/isPlainObject'; | ||
import $$observable from 'symbol-observable'; | ||
import $$observable from './symbol-observable'; | ||
import { | ||
@@ -103,3 +103,3 @@ Action, | ||
preloadedState?: S; | ||
noRecompute: boolean | undefined; | ||
noRecompute?: boolean | undefined; | ||
} | ||
@@ -278,3 +278,4 @@ | ||
} catch (err) { | ||
nextError = err.toString(); | ||
// eslint-disable-next-line @typescript-eslint/ban-types | ||
nextError = (err as object).toString(); | ||
if (isChrome) { | ||
@@ -907,3 +908,3 @@ // In Chrome, rethrowing provides better source map support | ||
return ({ | ||
return { | ||
...liftedStore, | ||
@@ -919,5 +920,5 @@ | ||
liftedStore.replaceReducer( | ||
(liftReducer( | ||
(nextReducer as unknown) as Reducer<S, A> | ||
) as unknown) as Reducer< | ||
liftReducer( | ||
nextReducer as unknown as Reducer<S, A> | ||
) as unknown as Reducer< | ||
LiftedState<S, A, MonitorState> & NextStateExt, | ||
@@ -953,3 +954,3 @@ LiftedAction<S, A, MonitorState> | ||
}, | ||
} as unknown) as Store<S & NextStateExt, A> & | ||
} as unknown as Store<S & NextStateExt, A> & | ||
NextExt & { | ||
@@ -994,4 +995,4 @@ liftedStore: Store< | ||
>( | ||
monitorReducer: Reducer<MonitorState, MonitorAction> = ((() => | ||
null) as unknown) as Reducer<MonitorState, MonitorAction>, | ||
monitorReducer: Reducer<MonitorState, MonitorAction> = (() => | ||
null) as unknown as Reducer<MonitorState, MonitorAction>, | ||
options: Options<OptionsS, OptionsA, MonitorState, MonitorAction> = {} | ||
@@ -1007,59 +1008,62 @@ ): StoreEnhancer<InstrumentExt<any, any, MonitorState>> { | ||
return <NextExt, NextStateExt>( | ||
createStore: StoreEnhancerStoreCreator<NextExt, NextStateExt> | ||
) => <S, A extends Action<unknown>>( | ||
reducer: Reducer<S, A>, | ||
initialState?: PreloadedState<S> | ||
) => { | ||
function liftReducer(r: Reducer<S, A>) { | ||
if (typeof r !== 'function') { | ||
if (r && typeof (r as { default: unknown }).default === 'function') { | ||
throw new Error( | ||
'Expected the reducer to be a function. ' + | ||
'Instead got an object with a "default" field. ' + | ||
'Did you pass a module instead of the default export? ' + | ||
'Try passing require(...).default instead.' | ||
); | ||
createStore: StoreEnhancerStoreCreator<NextExt, NextStateExt> | ||
) => | ||
<S, A extends Action<unknown>>( | ||
reducer: Reducer<S, A>, | ||
initialState?: PreloadedState<S> | ||
) => { | ||
function liftReducer(r: Reducer<S, A>) { | ||
if (typeof r !== 'function') { | ||
if (r && typeof (r as { default: unknown }).default === 'function') { | ||
throw new Error( | ||
'Expected the reducer to be a function. ' + | ||
'Instead got an object with a "default" field. ' + | ||
'Did you pass a module instead of the default export? ' + | ||
'Try passing require(...).default instead.' | ||
); | ||
} | ||
throw new Error('Expected the reducer to be a function.'); | ||
} | ||
throw new Error('Expected the reducer to be a function.'); | ||
return liftReducerWith<S, A, MonitorState, MonitorAction>( | ||
r, | ||
initialState, | ||
monitorReducer, | ||
options as unknown as Options<S, A, MonitorState, MonitorAction> | ||
); | ||
} | ||
return liftReducerWith<S, A, MonitorState, MonitorAction>( | ||
r, | ||
initialState, | ||
monitorReducer, | ||
(options as unknown) as Options<S, A, MonitorState, MonitorAction> | ||
); | ||
} | ||
const liftedStore = createStore(liftReducer(reducer)); | ||
if ( | ||
(liftedStore as Store< | ||
LiftedState<S, A, MonitorState> & NextStateExt, | ||
LiftedAction<S, A, MonitorState> | ||
> & | ||
NextExt & { | ||
liftedStore: Store< | ||
LiftedState<S, A, MonitorState>, | ||
const liftedStore = createStore(liftReducer(reducer)); | ||
if ( | ||
( | ||
liftedStore as Store< | ||
LiftedState<S, A, MonitorState> & NextStateExt, | ||
LiftedAction<S, A, MonitorState> | ||
>; | ||
}).liftedStore | ||
) { | ||
throw new Error( | ||
'DevTools instrumentation should not be applied more than once. ' + | ||
'Check your store configuration.' | ||
> & | ||
NextExt & { | ||
liftedStore: Store< | ||
LiftedState<S, A, MonitorState>, | ||
LiftedAction<S, A, MonitorState> | ||
>; | ||
} | ||
).liftedStore | ||
) { | ||
throw new Error( | ||
'DevTools instrumentation should not be applied more than once. ' + | ||
'Check your store configuration.' | ||
); | ||
} | ||
return unliftStore< | ||
S, | ||
A, | ||
MonitorState, | ||
MonitorAction, | ||
NextExt, | ||
NextStateExt | ||
>( | ||
liftedStore, | ||
liftReducer, | ||
options as unknown as Options<S, A, MonitorState, MonitorAction> | ||
); | ||
} | ||
return unliftStore< | ||
S, | ||
A, | ||
MonitorState, | ||
MonitorAction, | ||
NextExt, | ||
NextStateExt | ||
>( | ||
liftedStore, | ||
liftReducer, | ||
(options as unknown) as Options<S, A, MonitorState, MonitorAction> | ||
); | ||
}; | ||
}; | ||
} |
Sorry, the diff of this file is too big to display
148755
2
9
1869
18
- Removedsymbol-observable@^2.0.3
- Removedsymbol-observable@2.0.3(transitive)
Updatedlodash@^4.17.21