Errata: Wrong marble diagram for flatMap (page 147)?

Hi there,

I was re-reading the RxSwift book (2nd edition) to refresh some of the concepts and I didn’t understand the marble diagram for flatMap in page 147. After thinking a bit about it, I think it may be wrong:

In the box specifying the transformation you find:

flatMap { $0.value * 10 }

flatMap takes a function transforming an element into an observable, and as you state in the text,

The source observable is of an object type that has a value property that itself is an observable of type Int.

So if $0.value is an Observable<Int>, shouldn’t the text inside the box include the following instead?

flatMap { $0.value.map { $0 * 10 } }

Best regards
José

@scotteg Can you please help with this when you get a chance? Thank you - much appreciated! :]

Hi @jgongo, good catch! This was already fixed for the next release of the book (minus the map to keep the slide focused on flatMap) and will be fixed in the next update of this video course too. Thanks

1 Like

This topic was automatically closed after 166 days. New replies are no longer allowed.