[ad_1]
I’ve this code:
someRepository.selectedValuesPublisher
.sink { [weak self] _ in
self?.doSomething()
}.retailer(in: &cancelSet)
Right here is how I declare the writer
@Printed var selectedValues: EatingPreferencesSelectedValues
var selectedValuesPublisher: Printed<EatingPreferencesSelectedValues>.Writer { $selectedValues }
whereas selectedValues is a customized object that comprises 3 enums;
valueA: someEnum
valueB: someEnum
valueC: someEnum
My predominant difficulty is that I wish to invoke doSomething() simply in case the brand new worth of selectedValuesPublisher has been modified.
What’s the greatest strategy to that?
[ad_2]
