I really wish Disposables were inherited through closures. But that's not the case. You have to dispose of them manually if you wrap them in a function.
This will be solved with disposable stacks though.
This will be solved with disposable stacks though.
Comments
https://www.typescriptlang.org/play/?target=99&ts=5.9.0-dev.20250611#code/GYVwdgxgLglg9mABAZzgWwKYBEbIA5zICGARgDYYAUAlIgN4BQiiAThlCC0o88wNoBlAJ5oScMgDoAJrgLIMAXRr0mvZhASoKEsnADmlAEQ58hDCnTsAFjDB7D1ANyrmAX1Xv3DUJFgJEVhhkeBgsyjyIIMi2eogAbkRkIOYAvBaYJnKkFDTOzGwcXCpqgiJikjKm8kq0EWoaYFoYOvpGmWYBQSEsrOBgMQ55avGJyaWi4tKyZjVDbh4MXj7Q8EhoRLbhqlExiABecHCIaYHBobmLDAzrm05AA