Contents

init(upstream:predicate:)

Creates a publisher that waits until after the stream finishes and then publishes the last element of the stream that satisfies an error-throwing predicate closure.

Declaration

init(upstream: Upstream, predicate: @escaping (Publishers.TryLastWhere<Upstream>.Output) throws -> Bool)

Parameters

  • upstream:

    The publisher from which this publisher receives elements.

  • predicate:

    The error-throwing closure that determines whether to publish an element.