[✨] out-of-order streaming
Is your feature request related to a problem?
<Resource onPending/> is a client only feature, the server will always wait for the promise.
Describe the solution you'd like
I'd love to be able to use useResource$ on the server, but it pushes the onPending immediately and later replaces the onPending with onResolved.
Ideally there'd be some additional options:
- delay pending: what x ms for the resource before flushing the onPending
- timeout: cancel loading the resource and reject after x ms
Describe alternatives you've considered
tried a <SSRStreamBlock> Messed around with a few solutions, came to the messy conclusion proxying the data via an endpoint would probably be the best solution.
Additional context
Would allow for some good scenarios where you've got an API that loads fast most of the time, but sometimes is slow. Would allow the page to render with placeholders, before replacing with the data when needed.
It looks like Resource component neither show pending state, but also prevent subsequent component from rendering in server side. This behavior is inconsistent with client side.
this will be in v2