File tree Expand file tree Collapse file tree 1 file changed +0
-21
lines changed
Expand file tree Collapse file tree 1 file changed +0
-21
lines changed Original file line number Diff line number Diff line change @@ -73,24 +73,3 @@ buffer.push('first');
7373buffer .push (' stop' );
7474buffer .push (' ignored' ); // This value won't be processed since the buffer is closed after "stop".
7575```
76-
77-
78- ### API
79-
80- API
81-
82- new AsyncIterableBuffer<T >()
83-
84- Creates a new instance of the asynchronous buffer.
85-
86- Methods
87- - ** push(value: T): void**
88- Pushes a new value into the buffer. Throws an error if the buffer has been ended.
89- - ** end(): void**
90- Marks the buffer as completed and resolves any pending requests with { done: true }.
91- - ** next(): Promise<IteratorResult<T >>**
92- Returns a promise that resolves to the next buffered value. If the buffer is empty but not ended, it waits until a value is pushed.
93- - ** return(): Promise<IteratorResult<T >>**
94- Ends the buffer and returns a result indicating that the iterator is done. This is useful for early termination of iteration.
95- - ** [ Symbol.asyncIterator] ( ) : AsyncIterableIterator<T >**
96- Returns the async iterator itself, enabling for await...of loops.
You can’t perform that action at this time.
0 commit comments