mirror of https://github.com/sveltejs/svelte
21 lines
318 B
21 lines
318 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>
|