-
Notifications
You must be signed in to change notification settings - Fork 26
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
Re-rendering on clear #11
Comments
I just did something similar yesterday, I am implementing a refresh feature and want to trigger a re-render when the refresh is done. Here is the solution I came up with:
This approach doesn't quite accomplish what I want for refreshing (Suspense briefly renders the fallback), but it works great for re-rendering on clear. You could easily replace the store with useState, I have other reasons for using stores. The refreshThings function is a little ugly because I want to be able to await a call to refreshThings and have it resolve when the new data are available. |
A quick update... You can avoid the Suspend fallbacks flashing by changing The flashing of the Suspend fallbacks occurs because calling |
Love the simplicity of the API, I'm in the process of converting all my hand rolled suspense helpers over to this!
One piece of functionality I'd love to have in the library or at least your opinion on how to implement it separately best is forcing a re-render when the cache is cleared/updated.
The text was updated successfully, but these errors were encountered: