notherpleb
notherpleb
SSolidJS
Created by notherpleb on 12/2/2024 in #support
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.
export const route = {
load: async () => {
console.log("load!");
},
preload: async () => {
console.log("preload!");
},
} satisfies RouteDefinition;
export const route = {
load: async () => {
console.log("load!");
},
preload: async () => {
console.log("preload!");
},
} satisfies RouteDefinition;
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?
4 replies