Open
Description
If you want to use data provided by a publisher as a parameter or input to creating this publisher, there are two common means of enabling this:
Using the flatMap operator, using the data passed in to create or return a Publisher instance. This is a variation of the pattern illustrated in Using flatMap with catch to handle errors.
Alternately, map or tryMap can be used to create an instance of a publisher, followed immediately by chaining switchToLatest to resolve that publisher into a value (or values) to be passed within the pipeline.
The difference between the two alternative ways to create a publisher should be clearer.
When is it okay to use flatMap and when is it okay to use switchToLatest?
This is quite confusing.