You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
svelte/site/content/tutorial/07-lifecycle/02-ondestroy/app-a/Timer.svelte

21 lines
320 B

<script>
import { onInterval } from './utils.js';
export let callback;
export let interval = 1000;
onInterval(callback, interval);
</script>
<p>
This component executes a callback every
{interval} millisecond{interval === 1 ? '' : 's'}
</p>
<style>
p {
border: 1px solid blue;
padding: 5px;
}
</style>