The ability to reply to discussions is limited to PRO members. Want to join in the discussion? Click here to subscribe now.

Updating Data with Scan

Updating Data with Scan

2:10
You often need to update the data flowing through the stream with custom logic based on what you need to output. This lesson covers how to use `scan` for collecting and updating the outputs as your stream progresses.
Watch this lesson now
Avatar
egghead.io

You often need to update the data flowing through the stream with custom logic based on what you need to output. This lesson covers how to use scan for collecting and updating the outputs as your stream progresses.

Avatar
Leesh

Would be worth mentioning you are using Rx.Js 5 Beta! It's not very clear and I spent a good while trying to figure out why switchMapTo wasn't working.

Avatar
Albert

So essentially scan is equal to reduce, right? I don't understand why they always try to make another name in the world of RFP.

Avatar
John

@Albert - no, reduce can only occur once a stream has completed. scan continues to gather output from streams over time and can continually update.

They to have the same api/usage, but the distinction is critical.

In reply to Albert
HEY, QUICK QUESTION!
Joel's Head
Why are we asking?