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