Course lesson
We have some dummy data that we will use to get a grasp on data loading patterns in SvelteKit. Each route gets its on +page.svelte but we can also provide a route with a +page.js file that allows us to load data and expose it to our page.
We have some dummy data that we will use to get a grasp on data loading patterns in SvelteKit. Each route gets its on +page.svelte but we can also provide a route with a +page.js file that allows us to load data and expose it to our page.
You'll learn how this +page.js exports a load function that exposes a data object to the page you are loading data to. During this process, we'll use JSDoc to type our page data for some nice types.
Course lesson
We have some dummy data that we will use to get a grasp on data loading patterns in SvelteKit. Each route gets its on +page.svelte but we can also provide a route with a +page.js file that allows us to load data and expose it to our page.