Optionaldisposables:
DisposableType[]
Optional array of DisposableTypes added to the store.
A disposable store.
import { type IDisposable, disposableStore } from "@wopjs/disposable";
class A implements IDisposable {
dispose = disposableStore()
constructor() {
this.dispose.add(...);
}
}
class B implements IDisposable {
dispose = disposableStore()
a = this.dispose.add(new A())
constructor() {
this.dispose.add(...);
}
}
const b = new B();
b.dispose(); // dispose both `b` and `b.a`.
Create a DisposableStore that manages Disposers and IDisposables.
A DisposableStore is also a Disposer, which means it can be the
disposemethod of an IDisposable.A DisposableStore is also an IDisposable, which means it can be managed by another DisposableStore.