svelte ondestroy

Solutions on MaxInterview for svelte ondestroy by the best coders in the world

showing results for - "svelte ondestroy"
Fletcher
06 Sep 2019
1<script>
2	import { onDestroy } from 'svelte';
3
4	let counter = 0;
5	const interval = setInterval(() => counter += 1, 1000);
6
7	onDestroy(() => clearInterval(interval));
8</script>
similar questions
queries leading to this page
svelte ondestroy