partey_workadventure/desktop/local-app/src/lib/LazyRoute.svelte

21 lines
413 B
Svelte
Raw Normal View History

2022-02-20 20:30:53 +01:00
<script>
2022-02-22 10:05:21 +01:00
import { Route } from "svelte-navigator";
import Lazy from "~/lib/Lazy.svelte";
2022-02-20 20:30:53 +01:00
2022-02-22 10:05:21 +01:00
export let component;
export let delayMs = null;
2022-02-20 20:30:53 +01:00
2022-02-22 10:05:21 +01:00
let props;
$: {
// eslint-disable-next-line no-shadow
const { component, ...restProps } = $$props;
props = restProps;
}
2022-02-20 20:30:53 +01:00
</script>
<Route {...props}>
2022-02-22 10:05:21 +01:00
<Lazy {component} {delayMs}>
<slot />
</Lazy>
</Route>