Nicholas Jamieson
1 min readDec 24, 2017

--

Whether or not the types are inferred depends upon the TypeScript version. Versions prior to 2.4 will not infer the types. There were a number of changes made in 2.4 that relate to generic functions. In particular, I think it is this change that effects the correct inference.

With versions prior to 2.4, you’d have to explicitly specify the type parameters:

let x: Observable<number>;
x.pipe(map<number, number>(y => y + 1));

Which lessens the appeal of lettable operators with pre-2.4 versions of TypeScript.

--

--

Nicholas Jamieson
Nicholas Jamieson

Written by Nicholas Jamieson

RxJS core team member; front-end developer; mentor; speaker; open-source contributor

No responses yet