You can try using isDataRequest from the PageServerLoad arguments.
export const load: PageServerLoad = async ({ isDataRequest, params }) => {
const data = get(params.id);
return {
data: isDataRequest ? data : await data,
};
}
Link do docs about streaming promises:
https://kit.svelte.dev/docs/load#streaming-with-promises
Then you use the async block to display the skeleton.
Note: it might not work in dev mode, so build the site first.
You can see more info about this method in this article:
https://geoffrich.net/posts/conditionally-stream-data/\
(Keep in mind that you don't need to nest the promise object, SvelteKit 1.x behavior)