Skip to content

Conversation

@ntucker
Copy link
Collaborator

@ntucker ntucker commented Aug 10, 2023

Fixes #1548

Motivation

Similar to use case of invalidateAll(), but does not result in loading condition.

Solution

Add controller.expireAll() that sets all responses to STALE

controller.expireAll(ArticleResource.getList);

This is like controller.invalidateAll(); but will continue showing
stale data while it is refetched.

This is sometimes useful to trigger refresh of only data presently shown
when there are many parameterizations in cache.

@changeset-bot
Copy link

changeset-bot bot commented Aug 10, 2023

🦋 Changeset detected

Latest commit: 2886e2f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 13 packages
Name Type
@data-client/react Minor
@data-client/core Minor
@rest-hooks/core Minor
@rest-hooks/react Minor
@data-client/img Major
@data-client/redux Major
@data-client/ssr Major
@data-client/test Major
github-app Patch
next-app Patch
todo-app Patch
example-benchmark Patch
@rest-hooks/legacy Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Aug 10, 2023

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

Name Status Preview Comments Updated (UTC)
rest-hooks ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 10, 2023 10:03pm

@codecov
Copy link

codecov bot commented Aug 10, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.01% 🎉

Comparison is base (af8b760) 98.26% compared to head (2886e2f) 98.27%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2738      +/-   ##
==========================================
+ Coverage   98.26%   98.27%   +0.01%     
==========================================
  Files         113      115       +2     
  Lines        2015     2029      +14     
  Branches      306      306              
==========================================
+ Hits         1980     1994      +14     
  Misses         15       15              
  Partials       20       20              
Files Changed Coverage Δ
packages/core/src/actionTypes.ts 100.00% <100.00%> (ø)
packages/core/src/controller/Controller.ts 95.76% <100.00%> (+0.11%) ⬆️
packages/core/src/controller/createExpireAll.ts 100.00% <100.00%> (ø)
packages/core/src/state/reducer/createReducer.ts 100.00% <100.00%> (ø)
packages/core/src/state/reducer/expireReducer.ts 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

Question: Refetching paginated resource after mutation

2 participants