Skip to main content
Module

x/better_iterators/mod.ts>LazyAsync#groupBy

Chainable iterators (sync and async) for TypeScript, with support for opt-in, bounded parallelism
Latest
method LazyAsync.prototype.groupBy
import { LazyAsync } from "https://deno.land/x/better_iterators@v1.5.0/mod.ts";

Given keyFn, use it to extract a key from each item, and create a Map grouping items by that key.

Returns

Promise<Map<Key, T[]>>

Adds a valueFn to extract that value (instead of T) into a group.

Parameters

keyFn: Transform<T, Key>
valueFn: Transform<T, Value>

Returns

Promise<Map<Key, Value[]>>