Optional
interval: number = 1000The interval in milliseconds at which the Atom should update its value.
An Atom that automatically updates its value to the current time at the given interval.
const now = getNow();
console.log(now.value); // 0
const unsubscribe = now.subscribe(() => {
console.log(now.value); // Current time in milliseconds
});
Returns an Atom that automatically updates its value to the current time at the given interval. The interval is specified in milliseconds and defaults to 1000. When there are subscribers, the Atom updates its value at the specified interval. When there are no subscribers, the interval is cleared and the Atom's value is reset to 0.