init(upstream:predicate:)
Creates a publisher that publishes only elements that don’t match the previous element, as evaluated by a provided closure.
Declaration
init(upstream: Upstream, predicate: @escaping (Publishers.RemoveDuplicates<Upstream>.Output, Publishers.RemoveDuplicates<Upstream>.Output) -> Bool)Parameters
- upstream:
The publisher from which this publisher receives elements.
- predicate:
A closure to evaluate whether two elements are equivalent, for purposes of filtering. Return
truefrom this closure to indicate that the second element is a duplicate of the first.