docs: square odds example in rxjs guide (#24947)

Added argument type to filter function of rxjs. Fixed the
return value of filtering of odd numbers

PR Close #24947
This commit is contained in:
Arun Kumar 2018-07-18 11:55:36 +05:30 committed by Victor Berchet
parent ac7658e1b9
commit 7f3a5ec741

View File

@ -8,7 +8,7 @@ const nums = of(1, 2, 3, 4, 5);
// Create a function that accepts an Observable.
const squareOddVals = pipe(
filter(n => n % 2),
filter((n: number) => n % 2 !== 0),
map(n => n * n)
);