Primitives / API

foldkit-primitives/time

Functions

debounceDebounced input as a bundle factory: Changed restarts a timer, and the latest value settles as an OutMessage the placement must handle with onOut. Each…
formatRelativeTimeRelative time as a pure function: picks the unit (seconds through years) and delegates the wording to Intl.RelativeTimeFormat, so locales come from the…
ticksTicks while intervalMs answers Some, each tick one interval after the last and the first one interval after starting. A changed interval applies from the…

Values

IntervalA wall-clock interval as a bundle: the last tick time in the Model, advanced by a tick stream while running. Sibling of Timer (which counts ticks); this one…
IntervalMessage
IntervalModel
ThrottleLeading-edge throttle as a bundle: the first Attempted in an interval surfaces a Throttled OutMessage, the rest are dropped. Attempted reads the clock…
Throttled
ThrottleMessage
ThrottleModel
TimerA timer as a bundle: a count in the Model, advanced by a tick stream while running. The clock is Effect's, so tests drive it with TestClock instead of…
TimerMessage
TimerModel