-
Notifications
You must be signed in to change notification settings - Fork 21
TCA-590 use swr for data fetching in learn -> TCA-586 #391
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
TCA-590 use swr for data fetching in learn -> TCA-586 #391
Conversation
…oviders to use SWR
…ta-fetching-in-learn
testflyjets
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This all looks great but it's not clear to me what the mechanism is to invalidate the client-side data caches if we update data in DynamoDB. Can you clarify that for me?
brooketopcoder
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, but I am also curious about how the cache is invalidated. Is it related to the revalidateInMount config option? What mechanism does it use to revalidate? Does it just make the call again in the bg?
Ah, I think I get it -- SWR == "stale while refreshing" -- the cached data is provided while fresh data is retrieved in the background. All good. |
|
Hey @testflyjets @brooketopcoder ! Yeah, the cached data is served while the new data is fetched in the background. |
https://topcoder.atlassian.net/browse/TCA-590
Uses swr package to make the fetching requests for the learn tool.