Skip to content

Investigate behaviour of parent computation lifecycle vs root dispose #21

@JAForbes

Description

@JAForbes

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions