Instance Method


Publishes only elements that don’t match the previous element, as evaluated by a provided error-throwing closure.


func tryRemoveDuplicates(by predicate: @escaping (Upstream.Output, Upstream.Output) throws -> Bool) -> Publishers.TryRemoveDuplicates<Publishers.Buffer<Upstream>>



A closure to evaluate whether two elements are equivalent, for purposes of filtering. Return true from this closure to indicate that the second element is a duplicate of the first. If this closure throws an error, the publisher terminates with the thrown error.

Return Value

A publisher that consumes — rather than publishes — duplicate elements.