How can I test that all computations were created in a root?
I have a complicated hook that creates a bunch of memos and other signals that have a somewhat complex lifecycle. I have tests that check that the behaviour is correct, but usually the clearest way I see that something's gone wrong is if warnings show up in the test messages. Is there a way that I can check that all computations were created in a root, and if possible, can I check that they were created in a particular root and therefore cleaned up when that root is disposed?
4 Replies
Is there a way that I can check that all computations were created in a rootyou can check if
getOwner()
is null
to see if the memo was created outside of a rootSolid Playground
Quickly discover what the solid compiler will generate from your JSX template
Thanks, that's helpful!
ur very welcome!