When to use flatMap operator

Take a look at the following list—it contains the contexts and situations where flatMap will fit best:

  • When you're working with a list of data within a page, activity, or fragment and want to send some data to a server or a database per item of the list. The concatMap operator will also do here; however, as the flatMap operator works asynchronously, it'll be faster, and, as you're sending data, the order doesn't really matter.
  • Whenever you want to perform any operation on list items asynchronously and in a comparatively short time period.
..................Content has been hidden....................

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