Skip to content

Commit

Permalink
Merge pull request #3428 from cheprasov/patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
markerikson authored May 13, 2023
2 parents 1e5c7a0 + 58476a0 commit 3bb0e1b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/toolkit/src/immutableStateInvariantMiddleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,13 @@ function trackProperties(
isImmutable: IsImmutableFunc,
ignorePaths: IgnorePaths = [],
obj: Record<string, any>,
path: string = ''
path: string = '',
checkedObjects: Set<Record<string, any>> = new Set()
) {
const tracked: Partial<TrackedProperty> = { value: obj }

if (!isImmutable(obj)) {
if (!isImmutable(obj) && !checkedObjects.has(obj)) {
checkedObjects.add(obj);
tracked.children = {}

for (const key in obj) {
Expand Down

0 comments on commit 3bb0e1b

Please sign in to comment.