Skip to content

subscribe

subscribe(listener): () => void

Defined in: clock.ts:58

useSyncExternalStore-compatible subscribe. Adds the listener, lazily starts the interval if this is the first subscriber, and returns the teardown that removes the listener and (if it was the last) stops the interval.

ParameterType
listenerListener

() => void