Kodeco Forums

RxSwift: Transforming Operators in Practice

Learn how to work with transforming operators in RxSwift, in the context of a real app, in this tutorial taken from our latest book, RxSwift: Reactive Programming With Swift!


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/677-rxswift-transforming-operators-in-practice

Consider the fact that flatMap only emits the values of an observable when the observable completes. Therefore, if an observable does not complete, flatMap will never emit any values.

I’ve never seen any description of such behavior in the docs. Actually I just performed a simple test, flatMap emits values as soon as the Observable does.

agreed, not sure how this got there - must’ve thought about toArray while was writing that. it’s removed now

And I’m not sure about never() operator. I’ve been using RxSwift for a while, still not 100% confident how it works, but i guess if Observable.never() never produces a .completed event, the subscription will be active forever (well, until ViewController and its bag are released). Wouldn’t it be better to use Observable.empty() instead?

This tutorial is more than six months old so questions are no longer supported at the moment for it. We will update it as soon as possible. Thank you! :]