X-Git-Url: https://git.josue.xyz/?p=VSoRC%2F.git;a=blobdiff_plain;f=node_modules%2Fxterm%2Fsrc%2Fcommon%2FLifecycle.ts;fp=node_modules%2Fxterm%2Fsrc%2Fcommon%2FLifecycle.ts;h=0000000000000000000000000000000000000000;hp=ad1afa1dace81f0710f75ef326a6da146c8c565a;hb=5e96dd57ddd883604e87f62bdddcb111c63a6e1a;hpb=acb5f682a2b75b972710cabd81658f63071324b0 diff --git a/node_modules/xterm/src/common/Lifecycle.ts b/node_modules/xterm/src/common/Lifecycle.ts deleted file mode 100644 index ad1afa1..0000000 --- a/node_modules/xterm/src/common/Lifecycle.ts +++ /dev/null @@ -1,47 +0,0 @@ -/** - * Copyright (c) 2018 The xterm.js authors. All rights reserved. - * @license MIT - */ - -import { IDisposable } from 'common/Types'; - -/** - * A base class that can be extended to provide convenience methods for managing the lifecycle of an - * object and its components. - */ -export abstract class Disposable implements IDisposable { - protected _disposables: IDisposable[] = []; - protected _isDisposed: boolean = false; - - constructor() { - } - - /** - * Disposes the object, triggering the `dispose` method on all registered IDisposables. - */ - public dispose(): void { - this._isDisposed = true; - this._disposables.forEach(d => d.dispose()); - this._disposables.length = 0; - } - - /** - * Registers a disposable object. - * @param d The disposable to register. - */ - public register(d: T): void { - this._disposables.push(d); - } - - /** - * Unregisters a disposable object if it has been registered, if not do - * nothing. - * @param d The disposable to unregister. - */ - public unregister(d: T): void { - const index = this._disposables.indexOf(d); - if (index !== -1) { - this._disposables.splice(index, 1); - } - } -}