Added onInit and useInitialized hooks

This commit is contained in:
peterkogo
2024-01-18 12:14:12 +01:00
parent 7c49121c6e
commit 1fb668d936
10 changed files with 113 additions and 3 deletions
@@ -0,0 +1,14 @@
<script lang="ts">
import { onMount } from 'svelte';
let _onMount: (() => void) | undefined = undefined;
export { _onMount as onMount };
let _onDestroy: (() => void) | undefined = undefined;
export { _onDestroy as onDestroy };
onMount(() => {
_onMount?.();
return _onDestroy;
});
</script>
@@ -0,0 +1 @@
export { default as CallOnMount } from './CallOnMount.svelte';