https://remix.run/docs/en/main/utils/defer
https://remix.run/docs/en/main/guides/streaming#3-deferring-data-in-loaders
maybe something that needs to be manually set up, but at least if it can be done, it's sufficient
12 messages · Page 1 of 1 (latest)
https://remix.run/docs/en/main/utils/defer
https://remix.run/docs/en/main/guides/streaming#3-deferring-data-in-loaders
maybe something that needs to be manually set up, but at least if it can be done, it's sufficient
Yes, need to update docs on this.
routeLoader$(() => {
// returning a function means don't wait for response.
return () => {
return await some_data;
}
})
Hi @paper wren , do you have a more detailed example? as component$ can't accept an async function, how do you then await for that response? By the time you are rendering the markup its still a promise
I made it but it blocks any interaction, is this the only way or am I doing it wrong?
// ...
return async () => await houses;
});
export default component$(() => {
const listingsResPromise = useGetListings();
useVisibleTask$(async () => {
listingsRes.value = await listingsResPromise.value
isStreaming.value = false;
});
return ()
});
Is useResource something you are looking for? https://qwik.builder.io/tutorial/reactivity/resource/
I went for a walk and thought exactly the same, will check this later on. Thanks for taking the time to answer me!
thanks for taking the time to play with Qwik.
sorry for digging up an old thread, but I think this is still a problem.
using Resource with a streamed response always blocks rendering? Is that intentional? Is there a way to not block rendering (kind of defeats the purpose of streaming a response if it blocks the whole route, no?