When does load and preload run?
I started a solidstart project I'm toying with and I'm not understanding some of the data fetching model.
Is there any point combining the two? Because I only see "load" when I comment out the preload function. But either way, when I hover the link it still preloads but calls the load function.
When and for what should I use them?
3 Replies
load
is the old name for preload
, it's a feature of solid router: https://docs.solidjs.com/solid-router/reference/preload-functions/preload
they're called before navigating and on link hovers so that you can start fetching data earlierOk, that makes more sense. Just to be sure, you retrieve that preloaded data by defining some
getData
wrapped by a query
?Yes.