From c4c66889cc88ef83dd756468f6776168e83fdc96 Mon Sep 17 00:00:00 2001 From: Simon Holthausen Date: Thu, 22 Jun 2023 19:08:36 +0200 Subject: [PATCH] try this --- .../blog/2023-02-21-streaming-snapshots-sveltekit.md | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/documentation/blog/2023-02-21-streaming-snapshots-sveltekit.md b/documentation/blog/2023-02-21-streaming-snapshots-sveltekit.md index 49aa05d4ac..899dc169c4 100644 --- a/documentation/blog/2023-02-21-streaming-snapshots-sveltekit.md +++ b/documentation/blog/2023-02-21-streaming-snapshots-sveltekit.md @@ -18,9 +18,7 @@ Now, in SvelteKit 1.8, we have a new solution: you can return a nested promise f For example, consider the following `load` function: ```ts -/// file: +page.server.ts -import type { PageServerLoad } from './$types'; - +// @errors: 2304 export const load: PageServerLoad = () => { return { post: fetchPost(), @@ -34,7 +32,6 @@ export const load: PageServerLoad = () => { SvelteKit will automatically await the `fetchPost` call before it starts rendering the page, since it’s at the top level. However, it won’t wait for the nested `fetchComments` call to complete – the page will render and `data.streamed.comments` will be a promise that will resolve as the request completes. We can show a loading state in the corresponding `+page.svelte` using Svelte’s [await block](https://svelte.dev/docs#template-syntax-await): ```svelte -