Skip to main content
Partas

Timer

IntervalOrTimeout

type IntervalOrTimeout = (unit -> unit) -> int -> int

makeTimer

let makeTimer(
callback: unit -> unit,
timespan: int,
policy: IntervalOrTimeout
): DisposeCallback

Makes an automatically cleaned up timer. Takes a callback, the timespan, and then either the function setInterval or setTimeout as its base.

createTimer

let createTimer(
callback: unit -> unit,
timespan: int | Accessor<U2<bool, int>> | Accessor<bool> | Accessor<int>,
policy: IntervalOrTimeout
): unit

makeTimer but with a fully reactive delay. The delay can also be set to false in which case the timer is disabled.

createTimeoutLoop

let createTimeoutLoop(
callback: unit -> unit,
timespan: int | Accessor<int>
): unit

Similar to an interval created with createTimer, but the delay does not update until the callback is executed.

createPolled

let createPolled(
callback: unit -> 'T,
timespan: int | Accessor<int>
): Accessor<'T>

Periodically polls a function, returning an accessor to its last return value.

createIntervalCounter

let createIntervalCounter(timespan: int | Accessor<int>): Accessor<int>

A counter which incremements periodically on a delay.

Last updated: 7/11/25, 1:35 AM

PartasBuilt using the Partas.SolidStart SolidBase template
Community
githubdiscord