Allow asset hydration
Some frameworks like Next performs data prefetching in the server-side, providing the initial data for the whole app. Libraries like swr and react-query takes advantage of this by using the prefetched data as the initial cache data and performs the fetch process/cache invalidation only on client-side.
Asset hydration helps because React SSR cannot handle nor does not support Suspense (CM, however, supports this) and since the asset is guaranteed to have an initial data, the component does not have to suspend during SSR and the potentially suspending component can safely present its success UI.
I think something like asset.hydrate(args, data) or useAsset(asset, args, initialData) is a good API. Thoughts?
seems useful, would you want to open a pr for this?
@drcmda I'm willing to, although I have yet to address some minor issues in the code (e.g. type unsoundness). I'll probably address those on a separate issue
edit: Just saw @dai-shi 's commits, looks like the issues are fixed.