@johngw/stream
Version:
Reactive programming tools using the WHATWG Streams API.
16 lines (15 loc) • 382 B
text/typescript
/**
* Hold up a stream until a promise resolves. If it errors,
* the error will be emitted to the stream.
*
* @group Transformers
* @example
* ```
* ----a-------b------|
*
* interpose(async () => await setTimeout(50))
*
* --------a--------b-|
* ```
*/
export declare function interpose<T>(promise: Promise<void> | ((chunk: T) => Promise<void>)): TransformStream<T, T>;