Skip to content

repeat

repeat(options): <A>(task) => Task<A[]>

Defined in: Core/Task.ts:161

Runs a Task a fixed number of times sequentially, collecting all results into an array. An optional delay (ms) can be inserted between runs.

number

number

<A>(task): Task<A[]>

A

Task<A>

Task<A[]>

pipe(
  pollSensor,
  Task.repeat({ times: 5, delay: 1000 })
)(); // Task<Reading[]> — 5 readings, one per second