Skip to content

@epikodelabs/streamix


@epikodelabs/streamix / src/public-api / getIterator

Function: getIterator() ​

getIterator<T>(iterable): AsyncIterator<T, any, any> | Iterator<T, any, any>

Defined in: projects/libraries/streamix/src/lib/utils/coordinator.ts:646

Gets an iterator from an iterable object. Supports both synchronous and asynchronous iterables.

Type Parameters ​

T ​

T

Parameters ​

iterable ​

AsyncIterable<T, any, any> | Iterable<T, any, any>

The iterable to get an iterator from.

Returns ​

AsyncIterator<T, any, any> | Iterator<T, any, any>

An AsyncIterator or Iterator.

Throws ​

If the provided object is not iterable.

Released under the MIT License.