Current Data vs Data - need a way to conditionally opt out of SWR approach #5043
maksnester
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Consider a request like this
/api/:parentEntity/:childEntity
So I have a query like
So I'd like to show the stale data when childId changes, but I never want to show the stale data that is related to a different parent entity.
currentData
isn't exactly the right solution here as it'll never show the cached data between childId changes.For now, the only way I know to achieve the best of both is to create a custom hook like
But I'd prefer some library-level solution to this, somewhat like:
Beta Was this translation helpful? Give feedback.
All reactions