Mic*_*hal 4 invalidation reactjs react-cache
如何使由创建的资源无效react-cache?
我可以从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>;
Run Code Online (Sandbox Code Playgroud)
但是,当我在后端更新数据时,我无法重新获取前端的数据。
这是我唯一能找到的官方文档:https : //github.com/sw-yx/fresh-concurrent-react/blob/master/apis/react-cache.md
我可以使用一些未公开的API吗?
| 归档时间: |
|
| 查看次数: |
687 次 |
| 最近记录: |