·
3 commits
to main
since this release
Minor Changes
-
#706
4045d2d
Thanks @marvinhagemeister! - feat: support disposingeffect()
with resource managementThis allows
effect()
's to be disposed with the newusing
keyword from the explicit resource management proposal.Whenever an effect goes out of scope the
Symbol.dispose
function is called automatically.const count = signal(0); function doSomething() { // The `using` keyword calls dispose at the end of // this function scope using _ = effect(() => { console.log(count.value); return () => console.log("disposed"); }); console.log("hey"); } doSomething(); // Logs: // 0 // hey // disposed