HH\Map::lazy

Returns a lazy, access elements only when needed view of the current Map

public function lazy(): HH\Rx\KeyedIterable<Tk, Tv>;

Normally, memory is allocated for all of the elements of the Map. With a lazy view, memory is allocated for an element only when needed or used in a calculation like in map() or filter().

Return Values

  • HH\Rx\KeyedIterable<Tk, Tv> - a KeyedIterable representing the lazy view into the current Map.