Is this a bug in @Published?

I don't think the issue is the willChange notification that SwiftUI uses but rather the difference between when the wrapped value is updated vs. when the actual publisher is fired (at least if the OpenCombine implementation is accurate in that respect). This issue shows up when, in a Combine stream from the publisher, the property is access. In that case, the stream has the new value while the property has the old value, leaving us with the unexpected behavior.

2 Likes