IterableExtensions<E> extension

Extends Iterables with some common helper properties and functions

since 0.0.1

on

Methods

filterWhen(bool condition, bool predicate(E element)) Iterable<E>
Returns a lazily filtered Iterable (via Iterable.where) using the provided predicate when the supplied condition is true. Otherwise returns the original, un-filtered, Iterable.
groupBy<K>(K key(E)) Map<K, List<E>>
Groups the elements by the value returned by key.
partition(int n) Iterable<Iterable<E>>
Returns an Iterable of Iterables of n items each without overlap.
peek(void fn(E element)) Iterable<E>
Returns an Iterable consisting of the elements of this iterable, additionally performing the provided action on each element as elements are consumed from the resulting iterable