This repository was archived by the owner on Jun 29, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 28
This repository was archived by the owner on Jun 29, 2022. It is now read-only.
[quality] Align DisposableCollection with Theia? #14
Copy link
Copy link
Open
Description
The DisposableCollection is cool and convenient to use, however, what we have fixed in Theia never got back to here. Time to update or publish the DisposableCollection to npmjs and we do not have to copy-paste the code over and over.
See the diffs:
vscode-ws-jsonrpc/src/disposable.ts
Lines 12 to 33 in b9dbfda
| protected readonly disposables: Disposable[] = []; | |
| dispose(): void { | |
| while (this.disposables.length !== 0) { | |
| this.disposables.pop()!.dispose(); | |
| } | |
| } | |
| push(disposable: Disposable): Disposable { | |
| const disposables = this.disposables; | |
| disposables.push(disposable); | |
| return { | |
| dispose(): void { | |
| const index = disposables.indexOf(disposable); | |
| if (index !== -1) { | |
| disposables.splice(index, 1); | |
| } | |
| } | |
| } | |
| } | |
| } |
Metadata
Metadata
Assignees
Labels
No labels