Skeleton: Delegate data fetching to specific routes and only load what's needed
This commit is contained in:
10
src/routes/data/raceresults/+page.ts
Normal file
10
src/routes/data/raceresults/+page.ts
Normal file
@ -0,0 +1,10 @@
|
||||
import { fetch_drivers, fetch_raceresults, fetch_races } from "$lib/fetch";
|
||||
import type { PageLoad } from "../../$types";
|
||||
|
||||
export const load: PageLoad = async ({ fetch }) => {
|
||||
return {
|
||||
drivers: fetch_drivers(fetch),
|
||||
races: fetch_races(fetch),
|
||||
raceresults: fetch_raceresults(fetch),
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user