Best way to make sure fetcher is called only one #956
Unanswered
GuichiZhao
asked this question in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
As mentioned #954, the timing of revalidating is invoked is unpredictable especially when
suspense
is present. Here is my proposed way of making sure the fetcher is called only once of the application lifecycleI know that the point of SWR is revalidation, but there are also other nice features out of the box without revalidation, so the correctness of such practice makes a lot of sense in some projects
Not sure such practice is a production-ready once
I suppose memorized fetcher is also a valid option
Any thoughts are welcomed.
Beta Was this translation helpful? Give feedback.
All reactions