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 bd576bb83f
commit 7c89af34a9
1 changed files with 1 additions and 1 deletions

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)
);