asyncOf
function asyncOf<T>(...values): AsyncGenerator<T>;Defined in: async-of.ts:11
Create an AsyncIterable from a list of values.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
T |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
…values |
T[] |
Returns
Section titled “Returns”AsyncGenerator<T>
Example
Section titled “Example”for await (const n of asyncOf(1, 2, 3)) { console.log(n); // 1, 2, 3}