Publishes the first element of a stream to satisfy a throwing predicate closure, then finishes.
- iOS 13.0+Beta
- macOS 10.15+Beta
- Mac Catalyst 13.0+Beta
- tvOS 13.0+Beta
- watchOS 6.0+Beta
- Xcode 11.0+Beta
A closure that takes an element as a parameter and returns a Boolean value that indicates whether to publish the element.
A publisher that only publishes the first element of a stream that satifies the predicate.
The publisher ignores all elements after the first. If this publisher doesn’t receive any elements, it finishes without publishing. If the predicate closure throws, the publisher fails with an error.