This project has been succeeded by GraphReFly. New development happens at graphrefly-ts. npm install @graphrefly/graphrefly
Skip to content

fromTimer()

Creates a raw callbag source that emits undefined once after a delay, then completes (END). If the signal is already aborted or aborts during the delay, sends END with the abort reason as an error (no DATA emitted).

Use with rawSubscribe to replace raw new Promise + setTimeout. Use firstValueFrom only at system boundaries when exiting callbag-land.

Signature

ts
function fromTimer(ms: number, signal?: AbortSignal): CallbagSource

Parameters

ParameterTypeDescription
msnumberDelay in milliseconds.
signalAbortSignalOptional AbortSignal to cancel the delay early.

Returns

A raw callbag source function.

Released under the MIT License.