Advanced Observable Flows Explained

In earlier chapters, we have already covered lots of ways that the Observable flows can be constructed. However, we left out some juicy details, for example, how the .flatMap() works.

Observable flows can be constructed to do many different and often complicated tasks. One can create flows where the result of two asynchronous actions will activate the next step only if certain conditions are satisfied. Alternatively, as we have already seen, different remote requests can be combined and, in case something goes wrong, the backup source can be used.

Here, we will cover several core methods that most developers will need to use at some point, such as the following:

  • .map()
  • .flatMap()
  • .zip()
  • .concat()
  • .merge()
  • .filter()
  • .combineLatest()
  • .firstElement()
  • .switchMap()

Most developers will find them useful sooner or later. The ideas here build heavily on functional programming, so if you are familiar with that, it should be pretty easy to grasp everything in this chapter.

Finally, we will provide examples for each of these methods so that it is easier to understand how they work.

To summarize, we will cover things like the following:

  • What is Observable unwrapping and how it should be used
  • How to pass values between different stages of the Observable
  • How to combine items from multiple Observables
  • Filtering items in the Observable flows
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.44.182