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.
15 lines
467 B
15 lines
467 B
import { writable, type Readable } from "svelte/store";
|
|
|
|
const currentTimeWritable = writable(new Date());
|
|
|
|
setInterval(() => {
|
|
currentTimeWritable.set(new Date());
|
|
}, 15000);
|
|
|
|
/**
|
|
* A readable store that is updated twice every minute with the current time. Mainly for the progress
|
|
* bar timers, but other coarse-grained timers could use it as well.
|
|
*/
|
|
const currentTime: Readable<Date> = { subscribe: currentTimeWritable.subscribe }
|
|
|
|
export default currentTime;
|