useAsyncCache
Perhaps we could add a similar API to useAsync, but have it work with suspense. I understand react-cache will give us a pattern here, but what would be nice is a simple way to convert a useAsync function into a Suspense-style thrown promise.
Could you please give a simple example?
@streamich take a look at react-query and this: https://reactjs.org/docs/concurrent-mode-suspense.html
It's still experimental right now though
Is there any progress? It will be cool to have a concurrent mode version useAsync
+1
Maybe like https://github.com/vigzmv/react-promise-suspense ?
Suspense-ized useAsync no longer needs properties for loading and error, and should return only value.
I am not sure if the name useAsyncCache is a good name.