Create an async iterable from a list of chunks.
( ...chunks: Array<StreamChunk> )
| 34 | |
| 35 | /** Create an async iterable from a list of chunks. */ |
| 36 | async function* streamOf( |
| 37 | ...chunks: Array<StreamChunk> |
| 38 | ): AsyncIterable<StreamChunk> { |
| 39 | for (const c of chunks) { |
| 40 | yield c |
| 41 | } |
| 42 | } |
| 43 | |
| 44 | /** Shorthand for common event sequences. */ |
| 45 | const ev = { |
no outgoing calls
no test coverage detected