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
bigmistqke
bigmistqke3d ago
Is there a way that I can check that all computations were created in a root
you can check if getOwner() is null to see if the memo was created outside of a root
bigmistqke
bigmistqke3d ago
Solid Playground
Quickly discover what the solid compiler will generate from your JSX template
MrJohz
MrJohzOP3d ago
Thanks, that's helpful!
bigmistqke
bigmistqke3d ago
ur very welcome!

Did you find this page helpful?