mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-12 11:15:14 +00:00
give each app its own page, preloading and session stores, using context
This commit is contained in:
@@ -7,12 +7,14 @@
|
||||
</script>
|
||||
|
||||
<script>
|
||||
import { preloading } from '@sapper/app';
|
||||
import { stores } from '@sapper/app';
|
||||
import { setContext } from 'svelte';
|
||||
|
||||
export let child;
|
||||
export let rootPreloadFunctionRan;
|
||||
|
||||
const { preloading } = stores();
|
||||
|
||||
setContext('x', { rootPreloadFunctionRan });
|
||||
</script>
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<script>
|
||||
import { page } from '@sapper/app';
|
||||
import { stores } from '@sapper/app';
|
||||
const { page } = stores();
|
||||
</script>
|
||||
|
||||
<h1>{$page.params.slug}</h1>
|
||||
|
||||
Reference in New Issue
Block a user