Solid Router 0.14 Suspense Behaviour

I have a non-Start app with Router 0.14. I wrapped Suspense around the children slot so I get blocking navigation which works correctly. But when I have a refetch button, it hides the current page instead of suspending Is this intended? In my real app which is still using router 0.8, this behaves correctly - I originally wanted to check if I can reproduce another strange behaviour with transitions & routing; but it's still 0.8, so I wanted to port to 0.14 first https://gist.github.com/marvin-j97/60bce5a1e78eb3c5d6c1dce4464875ab
No description
3 Replies
Madaxen86
Madaxen862w ago
If you mean suspend to "hold" the current data unitl the refetched has arrived you may use the .latest prop of the data like :
function APage() {
const [data, { refetch }] = createResource(() => dataA(/*cache buster*/ new Date()));

return <div>
<div>AAA data: {data.latest}</div>
<button onClick={() => refetch()}>Reload</button>
</div>
}
function APage() {
const [data, { refetch }] = createResource(() => dataA(/*cache buster*/ new Date()));

return <div>
<div>AAA data: {data.latest}</div>
<button onClick={() => refetch()}>Reload</button>
</div>
}
lobster theremin
thanks! must have missed that
Madaxen86
Madaxen862w ago
There was an update which now enables to show the Suspense’s fallback on refetch/revalidation but also having the Stale-while-revalidate approach.
Want results from more Discord servers?
Add your server