Skip to content
This repository has been archived by the owner on Jun 29, 2022. It is now read-only.

[quality] Align DisposableCollection with Theia? #14

Open
kittaakos opened this issue Dec 2, 2019 · 1 comment
Open

[quality] Align DisposableCollection with Theia? #14

kittaakos opened this issue Dec 2, 2019 · 1 comment

Comments

@kittaakos
Copy link

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:

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);
}
}
}
}
}

https://github.com/eclipse-theia/theia/blob/c4b4d3995ba81a80e36cd62d290dce2b23c8fd82/packages/core/src/common/disposable.ts#L38-L102

@akosyakov
Copy link
Contributor

I think we should get rid of this package and merge it in Theia, something like @theia/jsonrpc. Also see eclipse-theia/theia#1783

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants