Instance Method

last(where:)

Only publishes the last element of a stream that satisfies a predicate closure, after the stream finishes.

Declaration

func last(where predicate: @escaping ((A.Output, B.Output)) -> Bool) -> Publishers.LastWhere<Publishers.CombineLatest<A, B>>

Parameters

predicate

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

Return Value

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