Instance Method

tryLast(where:)

Publishes only the last element of a stream that satisfies an error-throwing predicate closure, after the stream finishes.

Declaration

func tryLast(where predicate: @escaping ((A.Output, B.Output, C.Output)) throws -> Bool) -> Publishers.TryLastWhere<Publishers.Zip3<A, B, C>>

Parameters

predicate

A closure that takes an element as its parameter and returns a Boolean value that indicates whether to publish the element.

Return Value

A publisher that only publishes the last element satisfying the given predicate.

Discussion

If the predicate closure throws an error, the publisher fails with the thrown error.