Lifecycle

<script>
import { onMount } from 'svelte'

onMount(() => {
  console.log('Mounting')
  return () => console.log('going out')
})
</script>


// Other lifecycle functions
[
  onMount(() => {}),
  beforeUpdate(() => {}),
  afterUpdate(() => {}),
  onDestroy(() => {})
]
Comments
Related