-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to stop propagating values to children #145
Comments
Doesn't really answer your question, but I've grown to think that Reactive "wants you" to view the signal graph as static. If one buys into that viewpoint, then the answer is presumably "use |
Hm, but I basically want to reset a signal... I found a work around with binding it to some other signal and then just closing that, and creating a new surrogate... But it's pretty inconvenient! |
Hi, For situations where emptying the actions in the previous design did what you want, I expect that if you remove the parent from
if you then I think this behaviour is the same as it would have been if you'd removed all the actions from b2 in the old design though. (The reason that works the way it does, is that nodes will only run their actions if at least one of their parents is active in the current push - more info here: https://github.com/JuliaGizmos/Reactive.jl/blob/master/doc/Design%20Overview.md) You could achieve what you want more reliably with a flatten (which is actually implemented using
then when you're finished with b2, you can sub in a new Signal, b3 say:
Of course, that requires you to know what signal is going to be closed in advance, so you can use the flatten. I'm actually quite curious about your use case. Seems you get up to some pretty tricky stuff in your code @SimonDanisch - what between this, and not running the event loop, etc... 😄 |
the use case is to connect things to a slider, then reset the scene and connect new stuff. |
Ok, so the slider stays, but the objects go. Yeah removing the slider's signal from the Also, that reminds me, I think there might be an issue with GC and edited to add Reactive.nodes |
Did that work for you? Are you happy about it? Sad about it? |
Haven't tried it yet, but looks good! ;) |
In previous Reactive versions, I could just say
empty!(signal.actions)
, to stop a parent signal from sending values to children. Now this seems reversed and parents seem to add an action to their children, so emptying actions makes a signal not receive anything from their parents anymore.What's the best way to do this now?
The text was updated successfully, but these errors were encountered: