-
Notifications
You must be signed in to change notification settings - Fork 50.5k
Closed
Description
*Question
Link to StackOverflow: https://stackoverflow.com/questions/54558443/unstable-createresource-invalidation-in-react-cache-suspense
How do I invalidate a resource created by react-cache? 🙂
I can fetch data from API:
const FooResource = createResource(id => fetch(`/foo/${id}`)); // return a promise, or async/await
// inside render...
const fooResponse = FooResource.read(id); // suspends if not in cache; renders if in cache
return <div> {fooResponse} </div>;
However, if I updated the data on the backend I am currently unable to refetch the data on the frontend.
This is the only somehow official documentation that I was able to find: https://github.com/sw-yx/fresh-concurrent-react/blob/master/apis/react-cache.md
I know that this library is in active development. However is there some undocumented API that I can use? 🤔
Metadata
Metadata
Assignees
Labels
No labels