Marble diagrams: Indispensable for Rx concepts
You might have heard that Marble Diagrams are indispensable when it comes to learning Rx. If you have worked with any Reactive programming or if you want to switch to reactive programming for any specific language be in RxJava, RxSwift, RxJS etc., chances are that you have or will encounter Marble diagrams.
Marble diagrams are interactive diagrams that depict how Rx operators work with observable sequences.
Let’s have a look at a few examples and figure out how to work your way through Rx concepts by making use of Marble Diagrams.
Rx is all about working with Observable sequences; the way you work with them is by using one or more operators on them. Operators are methods of the various observable types as discussed in my blog: Basic building blocks of Functional reactive programming(FRP): IOS.
Consider this example:
You can visit RxMarbles.com to view and play around with marble diagrams for most Rx operators that you will find in RxSwift. For instance, from the preceding marble diagram, you can see how a map operator works.