Skip to content

feat: allow custom merge function for structuralSharing#3868

Merged
TkDodo merged 1 commit intoTanStack:mainfrom
richsilv:custom-structural-sharing
Aug 16, 2022
Merged

feat: allow custom merge function for structuralSharing#3868
TkDodo merged 1 commit intoTanStack:mainfrom
richsilv:custom-structural-sharing

Conversation

@richsilv
Copy link
Copy Markdown
Contributor

@richsilv richsilv commented Jul 19, 2022

As discussed here and here, this allows the provision of a function as the structuralSharing value, which effectively acts as a replacement for replaceEqualDeep. This way, consumers can still achieve the performance benefits of retained references even when cache data contains non-serializable values.

@vercel
Copy link
Copy Markdown

vercel bot commented Jul 19, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
query ✅ Ready (Inspect) Visit Preview Jul 19, 2022 at 5:24PM (UTC)

@codesandbox-ci
Copy link
Copy Markdown

codesandbox-ci bot commented Jul 19, 2022

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit fb3fcb3:

Sandbox Source
@tanstack/query-example-react-basic Configuration
@tanstack/query-example-react-basic-typescript Configuration

@richsilv richsilv force-pushed the custom-structural-sharing branch from 80c7b8b to fb3fcb3 Compare July 29, 2022 15:50
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Aug 13, 2022

Codecov Report

Merging #3868 (fb3fcb3) into main (eab6e2c) will increase coverage by 0.45%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main    #3868      +/-   ##
==========================================
+ Coverage   96.36%   96.81%   +0.45%     
==========================================
  Files          45       57      +12     
  Lines        2281     2668     +387     
  Branches      640      783     +143     
==========================================
+ Hits         2198     2583     +385     
- Misses         80       83       +3     
+ Partials        3        2       -1     
Impacted Files Coverage Δ
src/devtools/theme.tsx
src/core/queriesObserver.ts
src/react/QueryClientProvider.tsx
src/core/focusManager.ts
src/react/logger.native.ts
src/core/queryClient.ts
src/core/onlineManager.ts
src/core/infiniteQueryObserver.ts
src/react/useMutation.ts
src/devtools/useLocalStorage.ts
... and 92 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@TkDodo TkDodo merged commit f9ebf9a into TanStack:main Aug 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants