isc30 / linq-collections

Strongly typed Linq and Collections implementation for Javascript and TypeScript (ECMAScript 5)
https://www.npmjs.com/package/linq-collections
MIT License
119 stars 12 forks source link

ToLookup #20

Open isc30 opened 6 years ago

isc30 commented 6 years ago

A lookup is a 1:many inmutable map (multi-map; each key is mapped to an IQueryable<> of the values with that key).

Proposed definition:

toLookup<TKey extends Indexer, TValue>(
        keySelector: Selector<TOut, TKey>,
        valueSelector: Selector<TOut, TValue>)
        : IDictionary<TKey, IQueryable<TValue>>;

Can be implemented in a very similar way to GroupBy from List class

mkonicki commented 6 years ago

I will take that