Skip to content

Commit b3e8f20

Browse files
authored
Remove more unnecessary use of lodash (#1734)
1 parent 238a38f commit b3e8f20

File tree

3 files changed

+10
-12
lines changed

3 files changed

+10
-12
lines changed

packages/redux-devtools-app/package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
"@redux-devtools/ui": "^1.3.2",
4444
"localforage": "^1.10.0",
4545
"jsan": "^3.1.14",
46-
"lodash": "^4.17.21",
4746
"react-redux": "^9.1.2",
4847
"redux": "^5.0.1",
4948
"redux-persist": "^6.0.0",
@@ -62,7 +61,6 @@
6261
"@rjsf/core": "^5.20.0",
6362
"@types/jsan": "^3.1.5",
6463
"@types/json-schema": "^7.0.15",
65-
"@types/lodash": "^4.17.7",
6664
"@types/node": "^20.16.1",
6765
"@types/react": "^18.3.4",
6866
"@types/react-dom": "^18.3.0",

packages/redux-devtools-app/src/utils/monitorActions.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import difference from 'lodash/difference';
2-
import omit from 'lodash/omit';
31
import {
42
DispatchAction,
53
InstancesState,
@@ -11,10 +9,18 @@ import { Dispatch, MiddlewareAPI } from 'redux';
119
import { StoreActionWithoutLiftedAction } from '../actions';
1210

1311
export function sweep(state: State): State {
12+
const skippedActionIdsSet = new Set(state.skippedActionIds);
13+
1414
return {
1515
...state,
16-
actionsById: omit(state.actionsById, state.skippedActionIds),
17-
stagedActionIds: difference(state.stagedActionIds, state.skippedActionIds),
16+
actionsById: Object.fromEntries(
17+
Object.entries(state.actionsById).filter(
18+
([actionId]) => !skippedActionIdsSet.has(parseInt(actionId, 10)),
19+
),
20+
),
21+
stagedActionIds: state.stagedActionIds.filter(
22+
(actionId) => !skippedActionIdsSet.has(actionId),
23+
),
1824
skippedActionIds: [],
1925
currentStateIndex: Math.min(
2026
state.currentStateIndex,

pnpm-lock.yaml

Lines changed: 0 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)