UNPKG

@reactivex/ix-esnext-esm

Version:

The Interactive Extensions for JavaScript

20 lines (18 loc) 495 B
/** * @ignore */ export async function createGrouping(source, keySelector, elementSelector) { const map = new Map(); for await (const item of source) { const key = await keySelector(item); let grouping = map.get(key); if (!map.has(key)) { grouping = []; map.set(key, grouping); } const element = await elementSelector(item); grouping.push(element); } return map; } //# sourceMappingURL=_grouping.mjs.map