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 1executor(push, stop) receives functions to emit values and to terminate.
Methods / properties
| Member | Args | Kind | Description |
|---|---|---|---|
next() | 0 | method | Returns a promise for the next {value, done}. |
state | — | getter | Current repeater state. |
[Symbol.asyncIterator]() | 0 | method | Returns the async iterator (itself). |
Static functions (combinators)
| Function | Args | Description |
|---|---|---|
race(repeaters) | 1 | Yields from whichever input settles first. |
merge(repeaters) | 1 | Interleaves values from all inputs. |
zip(repeaters) | 1 | Yields tuples combining one value from each input. |
latest(repeaters) | 1 | Yields tuples of the latest value from each input whenever any input produces a value. |
Export list
Generated by utilities/doc-api.js from the repeater dump of utilities/api-surface.sh: 15 members. Edit the text above this block, not the block.
Repeater
class, constructible
- static methods:
latest(),merge(),race(),zip() - static values:
DONE = 3,INITIAL = 0,REJECTED = 4,STARTED = 1,STOPPED = 2 - methods:
next(),[Symbol.asyncIterator]() - properties:
state (get),[Symbol.toStringTag]