MCPcopy
hub / github.com/xtermjs/xterm.js / MandatoryMutableDisposable

Class MandatoryMutableDisposable

src/vs/base/common/lifecycle.ts:563–586  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

561 * exist and cannot be undefined.
562 */
563export class MandatoryMutableDisposable<T extends IDisposable> implements IDisposable {
564 private readonly _disposable = new MutableDisposable<T>();
565 private _isDisposed = false;
566
567 constructor(initialValue: T) {
568 this._disposable.value = initialValue;
569 }
570
571 get value(): T {
572 return this._disposable.value!;
573 }
574
575 set value(value: T) {
576 if (this._isDisposed || value === this._disposable.value) {
577 return;
578 }
579 this._disposable.value = value;
580 }
581
582 dispose() {
583 this._isDisposed = true;
584 this._disposable.dispose();
585 }
586}
587
588export class RefCountedDisposable {
589

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected