Saturday, November 21, 2026
HomeiOS Developmentios - comfort technique for mix publishers

ios – comfort technique for mix publishers

[ad_1]

I discover myself wanting the identical performance in Mix very often, so I wished to make a comfort technique like so…

public extension Revealed.Writer {
    func sinkChanges(receiveValue: @escaping (Self.Output) -> Void) -> AnyCancellable {
        self.dropFirst()
            .removeDuplicates()
            .sink(receiveValue: closure)
    }
}

Nonetheless I am fairly new to the syntax and I get the error

Referencing occasion technique 'removeDuplicates()' on 'Writer' requires that 'Publishers.Drop<Revealed<Worth>.Writer>.Output' (aka 'Worth') conform to 'Equatable'

I perceive why and what I’ve to do, simply no thought syntactically the place it goes…

My finest guess up to now was
public extension Revealed.Writer the place Output: Equatable {
but it surely did not like that… what ought to I be trying to find?

[ad_2]

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments