mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2025-07-27 00:19:55 +03:00
test-tab
This commit is contained in:
parent
929605b52c
commit
ab525dfc2e
|
@ -14,7 +14,7 @@ export const fromPath = (path: (string | number)[]) =>
|
||||||
|
|
||||||
function getState<S>(
|
function getState<S>(
|
||||||
s: { state: S; error?: string } | undefined,
|
s: { state: S; error?: string } | undefined,
|
||||||
// eslint-disable-next-line @typescript-eslint/ban-types
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
||||||
defaultValue?: {},
|
defaultValue?: {},
|
||||||
) {
|
) {
|
||||||
if (!s) return defaultValue;
|
if (!s) return defaultValue;
|
||||||
|
@ -25,7 +25,7 @@ export function compare<S>(
|
||||||
s1: { state: S; error?: string } | undefined,
|
s1: { state: S; error?: string } | undefined,
|
||||||
s2: { state: S; error?: string },
|
s2: { state: S; error?: string },
|
||||||
cb: (value: { path: string; curState: number | string | undefined }) => void,
|
cb: (value: { path: string; curState: number | string | undefined }) => void,
|
||||||
// eslint-disable-next-line @typescript-eslint/ban-types
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
||||||
defaultValue?: {},
|
defaultValue?: {},
|
||||||
) {
|
) {
|
||||||
const paths: string[] = []; // Already processed
|
const paths: string[] = []; // Already processed
|
||||||
|
@ -36,9 +36,8 @@ export function compare<S>(
|
||||||
let path = fromPath(event.newPath);
|
let path = fromPath(event.newPath);
|
||||||
|
|
||||||
if (event.type === 'remove-item' || event.type === 'move-item') {
|
if (event.type === 'remove-item' || event.type === 'move-item') {
|
||||||
if (paths.length && paths.indexOf(path) !== -1) return;
|
if (paths.length && paths.includes(path)) return;
|
||||||
paths.push(path);
|
paths.push(path);
|
||||||
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
||||||
const v = objectPath.get(s2.state as unknown as object, event.newPath);
|
const v = objectPath.get(s2.state as unknown as object, event.newPath);
|
||||||
curState = v.length;
|
curState = v.length;
|
||||||
path += '.length';
|
path += '.length';
|
||||||
|
|
Loading…
Reference in New Issue
Block a user