Skip to content

docs: selectInvalidedBy for multiple cache updates across queries#5226

Draft
bigcupcoffee wants to merge 9 commits intoreduxjs:masterfrom
bigcupcoffee:patch-1
Draft

docs: selectInvalidedBy for multiple cache updates across queries#5226
bigcupcoffee wants to merge 9 commits intoreduxjs:masterfrom
bigcupcoffee:patch-1

Conversation

@bigcupcoffee
Copy link

This is a rough sample of what we use in our mobile app to update an entity across 10+ queries without invalidating them all

Switch cases are easier to extend IMO, while in our code we have some abstration layer for draft updaters and entity predicates (as we have secondary identifier plus nested entities), this is more for the devs to figure out if they feel like they need it

For some queries we even have updates outside of redux with an according custom undo return, so this also keeps the room for obscure custom cases (which I wish I didn't have to see & code)

Code definitely feels somewhat weird but I feel like we still need a mention of this usecase for selectInvalidatedBy, for simplicity sake the code could only cover updating the list queries, but I figured I'd present a more complex case at this point, what do you think?

Could probably use some touch up on the wording, feel free to comment 🙏

@codesandbox
Copy link

codesandbox bot commented Feb 17, 2026

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

@codesandbox-ci
Copy link

codesandbox-ci bot commented Feb 17, 2026

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 c7f5662:

Sandbox Source
@examples-query-react/basic Configuration
@examples-query-react/advanced Configuration
@examples-action-listener/counter Configuration
rtk-esm-cra Configuration

@netlify
Copy link

netlify bot commented Feb 18, 2026

Deploy Preview for redux-starter-kit-docs ready!

Name Link
🔨 Latest commit c7f5662
🔍 Latest deploy log https://app.netlify.com/projects/redux-starter-kit-docs/deploys/699502635c486d0008d69a97
😎 Deploy Preview https://deploy-preview-5226--redux-starter-kit-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@aryaemami59 aryaemami59 added the docs Improvements or additions to documentation label Feb 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments