Transform: FlatMap and ConcatMap

Learn about transforming operators like FlatMap and ConcatMap.

FlatMap

The .flatMap() operator is another very common operator used to transform emissions from an Observable. The stream is transformed by applying a function that we specify to each emitted item. However, unlike .map(), the function specified should return an object of type Observable. The returned Observable is then immediately subscribed to and the sequence emitted by that Observable is then merged and flattened along with subsequent emissions, which are then passed along to the Observer.

Get hands-on with 1200+ tech skills courses.