I have an Observable Object GlobalOO with a @Published value
In any View , I can observe changes with .onReceive(globalOO.$value){ newValue in ...}
Now I only want to receive those changes according to a condition in the view @State private var isActive = false
.onReceive(globalOO.$value.drop(while: { _ in isActive == false })){newValue in ...}
This view modifier works but seems "weird" . Is there any possibility to create a view modifier that does exactly the same but more "compact". Thank you
Code could be shorter and more compact