ReactiveX / RxCpp

Reactive Extensions for C++
Apache License 2.0
3.05k stars 395 forks source link

Replacement for for_each operator #463

Closed pruthvikar closed 6 years ago

pruthvikar commented 6 years ago

Hi!

I noticed that there was a for_each operator in v1 in this commit https://github.com/ReactiveX/RxCpp/commit/803c2b5a9e68bacde47962cbbc86c875bdfb32ed

This is later removed but doesn't seem to have come back to v2. Is there a replacement for this?

Currently, I am using map and returning the value passed to the map lambda instead.

kirkshoop commented 6 years ago

Hi!

.for_each() in v1 was essentially the same as .as_blocking().subscribe() in v2. If you are using .map() right now but not changing the value, that can be replaced by .tap() in v2.

pruthvikar commented 6 years ago

Excellent!

That's the function I was looking for.