Small tweaks to readable store example

The current time should be stored by the callback when the first subscriber comes, and not when the readable is first created
pull/4903/head
Alessandro (Ale) Segala 5 years ago committed by GitHub
parent e34f208843
commit c84222d371
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -287,7 +287,8 @@ The second argument to `readable` is the same as the second argument to `writabl
```js
import { readable } from 'svelte/store';
const time = readable(new Date(), set => {
const time = readable(null, set => {
set(new Date());
const interval = setInterval(() => {
set(new Date());
}, 1000);

Loading…
Cancel
Save