A lazy, generator-based, JS library for handling sequences in a concise, efficient way.
Create a new iter
by passing its constructor an iterator.
const it = iter(new Set([1, 2, 3, 4]));
Return a filtered iter (lazy).
Return a mapped iter (lazy).
Return a limited iter.
Flatten any inner iterable of iterables.
const it = iter([
iter(counter()).map(x => x * 1).limit(3),
iter(counter()).map(x => x * 2).limit(3),
iter(counter()).map(x => x * 3).limit(3),
]).flatten();
const arr = Array.from(it);
t.deepEqual(arr, [0, 1, 2, 0, 2, 4, 0, 3, 6]);
Consume the iter
object in a functional manner. This function doesn't chain.