Repository navigation
removeDuplicates() on a DiffedValue publisher of ManagedState, UIState, or their bindings no longer drops an emission that changes the observed value.
Since 2.4.3, == compared the new values of two emissions. new reads the current value of the source, so two emissions of one source always had equal new values. Thus removeDuplicates() dropped a real change when the previous emission had the same old value. The failure occurred with $state.ui.list, observe(_:), map(keyPath:), safe(_:default:), and unsafe(_:).
Now ManagedState, UIState, and their bindings emit values that store the new value at the time of the emission:
==andhash(into:)compareoldand this stored value. A later change of the source does not change the result.newstill reads the current value of the source.- A
DiffedValuefrom a public initializer does not store its new value. The initializers do not callget, as in 2.5.0. For such a value,==andhash(into:)readnew.