{ } qjs-modules

repeater

Source: quickjs-repeater.c — module export: Repeater

An async-iterable push stream (similar to the @repeaterjs/repeater primitive): a producer callback pushes values that consumers receive via async iteration.

Constructor

new Repeater(executor)   // length 1

executor(push, stop) receives functions to emit values and to terminate.

Methods / properties

MemberArgsKindDescription
next()0methodReturns a promise for the next {value, done}.
state—getterCurrent repeater state.
[Symbol.asyncIterator]()0methodReturns the async iterator (itself).

Static functions (combinators)

FunctionArgsDescription
race(repeaters)1Yields from whichever input settles first.
merge(repeaters)1Interleaves values from all inputs.
zip(repeaters)1Yields tuples combining one value from each input.
latest(repeaters)1Yields tuples of the latest value from each input whenever any input produces a value.