Skip to content

Latest commit

 

History

History
110 lines (51 loc) · 2.34 KB

polyethylene.asynciterablebuilder.md

File metadata and controls

110 lines (51 loc) · 2.34 KB

Home > polyethylene > AsyncIterableBuilder

AsyncIterableBuilder class

A class that helps with building an AsyncIterable from a non-structured source.

In order to create the iteration, you must call the value, error and done methods with appropriate arguments.

Signature:

export default class AsyncIterableBuilder<T> implements AsyncIterable<T> 

Implements: AsyncIterable<T>

Remarks

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the AsyncIterableBuilder class.

Methods

Method

Modifiers

Description

[Symbol.asyncIterator]()

Allows this class to work as a regular AsyncIterable<T>

done()

Makes the underlying iterable finish the iteration.

error(error)

Makes the underlying iterable throw the given error object.

toPolyAsyncIterable()

Get a PolyAsyncIterable that iterates the elements as determined by calls to this object's value, error and done methods.

value(obj)

Gives the underlying iterable a new value to be yielded.