Skip to main content
Module

x/lazy/lib/lazy.ts>Lazy#groupBy

A linq-like lazy-evaluation enumerable/iteration library that aims to support deno, node & browser
Latest
method Lazy.prototype.groupBy
import { Lazy } from "https://deno.land/x/lazy@v1.7.3/lib/lazy.ts";

Groups the elements by key.

Parameters

keyFn: MapFn<TElement, TKey>

The function to extract the key from each element.

Groups the elements by key and projects each element using the given function.

Parameters

keyFn: MapFn<TElement, TKey>

The function to extract the key from each element.

elementSelector: MapFn<TElement, TItem>

The transformation function to use for each element.

Groups the elements by key and projects each element using the given function. The elements of each group are projected using the given function.

Type Parameters

TKey
TItem
TResult

Parameters

keyFn: MapFn<TElement, TKey>

The function to extract the key from each element.

elementSelector: MapFn<TElement, TItem>

The transformation function to use for each element.

resultSelector: CombineFn<TKey, Iterable<TItem>, TResult>

The transformation function to create the result elements with.