Ignores elements from the upstream publisher until it receives an element from a second publisher.
SDKs
- iOS 13.0+
- macOS 10.15+
- Mac Catalyst 13.0+
- tvOS 13.0+
- watchOS 6.0+
- Xcode 11.0+
Framework
- Combine
Declaration
func drop<P>(untilOutputFrom publisher: P) -> Publishers.Drop Until Output<Publishers.Try Comparison<Upstream>, P> where P : Publisher, Self.Failure == P.Failure
Parameters
publisher
A publisher to monitor for its first emitted element.
Return Value
A publisher that drops elements from the upstream publisher until the other
publisher produces a value.
Discussion
This publisher requests a single value from the upstream publisher, and it ignores (drops) all elements from that publisher until the upstream publisher produces a value. After the other
publisher produces an element, this publisher cancels its subscription to the other
publisher, and allows events from the upstream
publisher to pass through. After this publisher receives a subscription from the upstream publisher, it passes through backpressure requests from downstream to the upstream publisher. If the upstream publisher acts on those requests before the other publisher produces an item, this publisher drops the elements it receives from the upstream publisher.