RxSwift: Deep Inside FlatMap

A guide to understanding one of the most powerful (and confusing) operators for Combine and RxSwift

Michael Long
Better Programming
Published in
15 min readJan 25, 2021

--

For each value received, our closure { } will translate that value into an Observable that will return two values of its own.
Illustration via ReactiveX docs

One of the most powerful operations in the ReactiveX arsenal is FlatMap. And yet for many people, it’s also one of the hardest operators to get your head around.

--

--

I write about Apple, Swift, and SwiftUI in particular, and technology in general. I'm also a Lead iOS Engineer at InRhythm, a modern digital consulting firm.