Primitives / Time

foldkit-primitives/time

What the clock said last: a count of ticks, when the last one was, a value that settled after the typing stopped. Everything here runs on Effect's clock, so a test advances it with TestClock.adjust instead of waiting. (source)

NameFormModelMessagesArgs
Timerbundle{ count, running }Started, Stopped, Ticked{ intervalMs }
Intervalbundle{ running, lastAt }Started, Stopped, Ticked { at }{ intervalMs }
ticks({ intervalMs, onTick })entryyour Message
debounce({ name, value })bundle factory{ latest, generation }Changed { value }; out: Debounced { value }{ delayMs } + onOut
Throttlebundle{ lastAt }Attempted (and its own Evaluated { now }); out: Throttled { at }{ intervalMs } + onOut
formatRelativeTime(from, to, locale?)function