Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use structural sharing in addons if applicable #21

Open
klis87 opened this issue Jan 26, 2024 · 1 comment
Open

Use structural sharing in addons if applicable #21

klis87 opened this issue Jan 26, 2024 · 1 comment
Labels
enhancement New feature or request
Milestone

Comments

@klis87
Copy link
Owner

klis87 commented Jan 26, 2024

Currently we always normalize data after each query successful response. However, some libs like react-query uses structural sharing feature, which preserves data reference if it did not change. We could use this to normy advantage to give up normalization in such cases, as normalizating in this scenario will end up with the same normalized store.

This is especially useful for features like refetch on refocus, as then we can end up with multiple queries refetches at the same time, most of each will end up probably being the same.

@klis87 klis87 added the enhancement New feature or request label Jan 26, 2024
@klis87 klis87 added this to the version 1.0 milestone Jan 26, 2024
@klis87
Copy link
Owner Author

klis87 commented Feb 13, 2024

Done in https://github.com/klis87/normy/releases/tag/%40normy%2Fcore%400.10.0 .

I will keep it open though, as unfortunately for now it does not work with rtk-query. Awaiting reduxjs/redux-toolkit#4073

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant