You’d need to enclose the entire pipeline in parentheses, like this:

const value$ = (
range(0, 10)
|> filter(x => x % 2 === 0)
|> map(x => x + x)
|> scan((acc, x) => acc + x, 0)
|> toArray()
).subscribe(x => console.log(x));

For the draft spec, see this issue and this PR.

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

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store