A library for working with iterables and async iterables in a functional style, by transforming the iterations on the fly and getting results from them.
The entry point for this library is the Poly namespace, and the main iterable classes are PolySyncIterable and PolyAsyncIterable.
Class | Description |
---|---|
AsyncIterableBuilder | 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. |
PolyAsyncIterable | An This class works as an async version of PolySyncIterable, but all methods accept async function where possible and will always return either ## Concurrency Many operations of this class accept as a final argument an options object than can specify some options for concurrent operations. - The A concurrency value of 0 acts the same as a 1 concurrency-wise, but disables the concurrency completely, preventing any values to be requested before actually needed. Specifying concurrency greater or equal to 1 will make more elements be requested of the previous iterator than actually requested of the current one, similarly to PolyAsyncIterable.prefetch(). |
Abstract Class | Description |
---|---|
PolySyncIterable | A The methods of this class are intended to resemble those of |
Interface | Description |
---|---|
ConcurrencyOptions | Options for concurrency. |
Namespace | Description |
---|---|
Poly | Main namespace for the creation of PolySyncIterable and PolyAsyncIterable objects. |
Type Alias | Description |
---|---|
AsyncChunkingPredicate | A function that receives an element (elem ) of the iteration and the first and last element of a chunk, and returns a boolean value or a Promise to a boolean value representing whether elem should be added to the current chunk (if true ) or be the start of a new chunk (if false ) |
AsyncIndexedMapping | A function that receives an object (elem ) and its index in the iteration and returns a different object or a Promise to a different object |
AsyncIndexedPredicate | A function that receives an object (elem ) and its index in the iteration and returns a boolean value or a Promise to a boolean value. |
AsyncIndexedReducer | A function that receives an accumulated result, an element of an iteration, and returns a new accumulated result or a promise to a new accumulated result for the next call or as a final return value. |
AsyncIndexedRunnable | A function that receives an object (elem ) and its index in the iteration and either returns a Promise to nothing or doesn't return anything |
ChunkingPredicate | A function that receives an element (elem ) of the iteration and the first and last element of a chunk, and returns a boolean value representing whether elem should be added to the current chunk (if true ) or be the start of a new chunk (if false ) |
Comparator | A function that receives two objects elemA and elemB and returns a number value that is negative if elemA should be sorted before elemB , positive if elemA should be sorted after elemB , or 0 if they should be sorted at the same position. |
IndexedMapping | A function that receives an object (elem ) and its index in the iteration and returns a different object |
IndexedPredicate | A function that receives an object (elem ) and its index in the iteration and returns a boolean value. |
IndexedReducer | A function that receives an accumulated result, an element of an iteration, and returns a new accumulated result for the next call or as a final return value. |
IndexedRunnable | A function that receives an object (elem ) and its index in the iteration and doesn't return anything |
IndexedTypePredicate | A function that receives an object (elem ) and its index in the iteration and returns a boolean value indicating if elem is of the generic type U |
Tuple | A tuple of N elements of type T . |