flatMap(maxPublishers:_:)
Transforms all elements from an upstream publisher into a new publisher up to a maximum number of publishers you specify.
Declaration
func flatMap<P>(maxPublishers: Subscribers.Demand = .unlimited, _ transform: @escaping (Self.Output) -> P) -> Publishers.FlatMap<P, Self> where P : Publisher, P.Failure == NeverParameters
- maxPublishers:
Specifies the maximum number of concurrent publisher subscriptions, or Unlimited if unspecified.
- transform:
A closure that takes an element as a parameter and returns a publisher that produces elements of that type.
Return Value
A publisher that transforms elements from an upstream publisher into a publisher of that element’s type.