A publisher that “flattens” nested publishers.
- iOS 13.0+
- macOS 10.15+
- Mac Catalyst 13.0+
- tvOS 13.0+
- watchOS 6.0+
- Xcode 11.0+
Given a publisher that publishes Publishers, the
Switch publisher produces a sequence of events from only the most recent one. For example, given the type
Publisher<Publisher<Data, NSError>, Never>, calling
switch will result in the type
Publisher<Data, NSError>. The downstream subscriber sees a continuous stream of values even though they may be coming from different upstream publishers.