Instance Method

tryDrop(while:)

Omits elements from the upstream publisher until an error-throwing closure returns false, before republishing all remaining elements.

Declaration

func tryDrop(while predicate: @escaping (DeferredPublisher.Output) throws -> Bool) -> Publishers.TryDropWhile<Deferred<DeferredPublisher>>

Parameters

predicate

A closure that takes an element as a parameter and returns a Boolean value indicating whether to drop the element from the publisher’s output.

Return Value

A publisher that skips over elements until the provided closure returns false, and then republishes all remaining elements. If the predicate closure throws, the publisher fails with an error.