disposing of a `createRoot` nested inside a `createEffect`?
I am creating a nested effect, like:
Will the root be automatically disposed when the scope of the first
createEffect
gets disposed? How can I inspect that?6 Replies
1. roots won't ever be disposed manually - you control the disposal
2. not passing a parameter for the dispose function will actually create a "top-level" (unowned) root that doesn't have access to the context - creates it's own tree
3. you can use solid-devtools to see roots, where they are and when they are disposed
what's the dispose function?
createRoot(dispose => { dispose() })
Oh thanks a lot! It's really obscure. How come it's not returned as a value on createroot? The scope seems kinda weird
You can return anything from root, including the dispose function
oh. I... Did not know that.