mirror of https://github.com/sveltejs/svelte
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.
21 lines
318 B
21 lines
318 B
3 years ago
|
<script>
|
||
|
import { onInterval } from './utils.js';
|
||
|
|
||
|
export let callback;
|
||
|
export let interval = 1000;
|
||
|
|
||
|
onInterval(callback, interval);
|
||
|
</script>
|
||
|
|
||
|
<p>
|
||
1 year ago
|
This component executes a callback every
|
||
3 years ago
|
{interval} millisecond{interval === 1 ? '' : 's'}
|
||
|
</p>
|
||
|
|
||
|
<style>
|
||
1 year ago
|
p {
|
||
3 years ago
|
border: 1px solid blue;
|
||
|
padding: 5px;
|
||
|
}
|
||
|
</style>
|