This operator is similar to the flatMap() operator, but it only propagates items from the most recently transformed observable.
Imagine a search as you type feature. In this feature, for every key stroke you will do a search and present the current result in the screen; if you are accessing external resources such as a database or an API, some searches can take more time than others, and the naive implementation of this search (using flatMap() for instance) might show wrong results. Look at this example:
- A search box to search names in a database.
- The user types the letter J and starts a search for all available names starting with the letter J.
- The user types the letter O and starts a search for all available ...