Is there any way to conditionally block an @EnvironmentObject property from receiving its objectWillChange publisher? I'm making a custom @Store property wrapper for SwiftUI, which has an @EnvironmentObject property which subscribes to the central store, but only updates the view when some certain state has changed (specified by a keypath in the property wrapper's initialiser).
It seems like whenever an @EnvironmentObject property inside a property wrapper receives an objectWillChange, DynamicProperty does its magic and reloads the view. So, to stop DynamicProperty from reloading the view when some unused state changes (it'd be really nice to have some more information on how DynamicProperty works β I've looked through Tokamak's implementation, and am none the wiser
), I need to be able to block the objectWillChange publisher from ever arriving to the @EnvironmentObject. Since we can implement any custom publisher for objectWillChange, I was thinking of having it carry some type metadata about what state has changed, and then each @Store property wrapper can independently compare that to the given keypath and decide whether the objectWillChange should pass or not.
Is there any way to conditionally block the objectWillChange from arriving to the @EnvironmentObject to achieve this?