If you dispose a root, it won't dispose children in a nested root. This rewrite already has this behaviour.
But when a parent computation re-runs any nested computations are destroyed as the parent computation will recreate them.
In this case, what is meant to happen when the parent computation initiates a child root. Does the old child root automatically clean up, or is it meant to be protected?
S.computation(() => { // when this re-runs
S.root(() => {
S.computation(() => { // does this get destroyed?
})
})
})
I think it should be destroyed/recreated because that is how S works at the most basic level, but it seems to make root's less independent than you'd expect.
If you dispose a root, it won't dispose children in a nested root. This rewrite already has this behaviour.
But when a parent computation re-runs any nested computations are destroyed as the parent computation will recreate them.
In this case, what is meant to happen when the parent computation initiates a child root. Does the old child root automatically clean up, or is it meant to be protected?
I think it should be destroyed/recreated because that is how S works at the most basic level, but it seems to make root's less independent than you'd expect.