Skip to content

Commit

Permalink
fix: #4310
Browse files Browse the repository at this point in the history
  • Loading branch information
tmm committed Nov 6, 2024
1 parent afb2483 commit cb7dd2e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/smart-cobras-do.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@wagmi/core": patch
---

Removed unnecessary internal deep equal check in `structuralSharing`.
4 changes: 1 addition & 3 deletions packages/core/src/query/utils.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { type QueryKey, replaceEqualDeep } from '@tanstack/query-core'
import { deepEqual } from '../utils/deepEqual.js'

export function structuralSharing<data>(
oldData: data | undefined,
newData: data,
): data {
if (deepEqual(oldData, newData)) return oldData as data
return replaceEqualDeep(oldData, newData)
}

Expand Down Expand Up @@ -60,7 +58,7 @@ export function filterQueryOptions<type extends Record<string, unknown>>(

// import('@tanstack/query-core').InfiniteQueryObserverOptions
getPreviousPageParam, getNextPageParam, initialPageParam,

// import('@tanstack/react-query').UseQueryOptions
_optimisticResults, enabled, notifyOnChangeProps, placeholderData, refetchInterval, refetchIntervalInBackground, refetchOnMount, refetchOnReconnect, refetchOnWindowFocus, retryOnMount, select, staleTime, suspense, throwOnError,

Expand Down

0 comments on commit cb7dd2e

Please sign in to comment.