Instance Method

tryMax(by:)

Publishes the maximum value received from the upstream publisher, using the provided error-throwing closure to order the items.

Declaration

func tryMax(by areInIncreasingOrder: @escaping ((Output0, Output1), (Output0, Output1)) throws -> Bool) -> Publishers.TryComparison<Publishers.MapKeyPath2<Upstream, Output0, Output1>>

Parameters

areInIncreasingOrder

A throwing closure that receives two elements and returns true if they are in increasing order. If this closure throws, the publisher terminates with a Failure.

Return Value

A publisher that publishes the maximum value received from the upstream publisher, after the upstream publisher finishes.