#does something like Remix's "defer" exist?

12 messages · Page 1 of 1 (latest)

tall thistle
weak bough
#

👉🏻 #general message

paper wren
#

Yes, need to update docs on this.

routeLoader$(() => {
  // returning a function means don't wait for response.
  return () => {
    return await some_data;
  }
})
smoky dove
#

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

smoky dove
#

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 ()
});
paper wren
smoky dove
paper wren
#

thanks for taking the time to play with Qwik.

raven bobcat
#

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?

smoky dove
#

Yes, I realised the same thing after a while so not using it

#

I think Miško said that one of his goals for this year was out of order streaming. I guess that solves this behaviour