4 ms·
> continuously and unnecessarily iterating over everything in each function call multiple times. There is nothing to iterate over in Rx. An Observable is NOT a
by smadge 11y ago
> continuously and unnecessarily iterating over everything in each function call multiple times.
There is nothing to iterate over in Rx. An Observable is NOT a list. It can be an asynchronous sequence, for instance a sequence of mouse clicks, or events from a websocket. All it does is call onNext on the subscribed Observers. So it's not as if chaining a map and then a filter iterates over a collection twice. In your example, when the source Observable emits a new value, it calls onNext for the FilterObservable, which then calls onNext for the MapObservable.