Closed berndfuhrmann closed 4 months ago
IxJS version: 5.0.0
Code to reproduce:
import { toMap } from 'ix/iterable'; // ... const data = [{ key:'alpha', value:true }]; toMap<{ key:string, value:boolean }, string, boolean>(data, { keySelector: (item) => item.key });
Expected behavior: Typescript should compile this code.
Actual behavior: While the code itself seems to work, Typescript complains: Type 'string' is not assignable to type 'boolean'.ts(2322)
Additional information: In https://github.com/ReactiveX/IxJS/blob/master/src/asynciterable/tomap.ts and https://github.com/ReactiveX/IxJS/blob/master/src/iterable/tomap.ts the return value of keySelector should be TKey (or sth similar) instead of TElement.
keySelector
TKey
TElement
IxJS version: 5.0.0
Code to reproduce:
Expected behavior: Typescript should compile this code.
Actual behavior: While the code itself seems to work, Typescript complains: Type 'string' is not assignable to type 'boolean'.ts(2322)
Additional information: In https://github.com/ReactiveX/IxJS/blob/master/src/asynciterable/tomap.ts and https://github.com/ReactiveX/IxJS/blob/master/src/iterable/tomap.ts the return value of
keySelector
should beTKey
(or sth similar) instead ofTElement
.