Skip to content
This repository has been archived by the owner on Nov 23, 2024. It is now read-only.

Add utils.invalidateEntities #190

Merged
merged 5 commits into from
Mar 27, 2021
Merged

Add utils.invalidateEntities #190

merged 5 commits into from
Mar 27, 2021

Conversation

msutkowski
Copy link
Member

@msutkowski msutkowski commented Mar 27, 2021

This needs some help regarding the types because they're currently a 🥔.

Allows a user to invalidate entities at any point without firing off a mutation or calling refetch on a specific endpoint. Supports ['Entity', { type: 'OtherEntity' }, { type: 'EntityWithId', id: 1 }]

I also thought it'd be cool if we could do a const invalidate = useInvalidateEntities();, but I'm not sure of how to get the EntityTypes there without some magic.

@codesandbox-ci
Copy link

codesandbox-ci bot commented Mar 27, 2021

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 876510f:

Sandbox Source
React Configuration
React Typescript Configuration
rtk-query-demo Configuration
svelte-app-rtk-simplequery-demo Configuration

@github-actions
Copy link

github-actions bot commented Mar 27, 2021

size-limit report 📦

Path Size
ESM full 9.8 KB (+0.4% 🔺)
ESM full (React) 10.88 KB (+0.34% 🔺)
createApi + setupListeners 8.93 KB (+0.47% 🔺)
createApi (React) + setupListeners 9.89 KB (+0.43% 🔺)
fetchBaseQuery 661 B (0%)
retry 271 B (0%)
ApiProvider 400 B (0%)
CJS minfied 15.19 KB (+0.39% 🔺)
CJS React minfied 16.44 KB (+0.28% 🔺)

src/core/module.ts Outdated Show resolved Hide resolved
@msutkowski msutkowski changed the title Add internalActions.invalidateEntities action Add internalActions.invalidateEntities Mar 27, 2021
@msutkowski msutkowski changed the title Add internalActions.invalidateEntities Add utils.invalidateEntities Mar 27, 2021
@phryneas phryneas merged commit bcc3e00 into next Mar 27, 2021
@phryneas phryneas deleted the invalidate-entities-action branch March 27, 2021 16:49
@phryneas phryneas restored the invalidate-entities-action branch May 31, 2021 14:40
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants