How would you handle the state reducer with this change?
Benoît Quenaudon
1

Well, you can call doOnNext on subject, and you have access to current value of BehaviorSubject (getValue). Also, you can create BehaviorSubject with initial value passed to its constructor.

With this in mind, you can basically do the same things that scan does.

I mean scan is just a fancy functional operator that does ultra simple thing. In this particular case, your code will be much more readable and simple without it.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.