mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-25 11:08:51 +01:00
Revert "Revert "allow to reuse the same function/context when listening to events""
This reverts commit 4a3dbb6c44.
This commit is contained in:
@@ -37,12 +37,8 @@ export class ExtHostDocumentSaveParticipant implements ExtHostDocumentSavePartic
|
||||
|
||||
get onWillSaveTextDocumentEvent(): Event<vscode.TextDocumentWillSaveEvent> {
|
||||
return (listener, thisArg, disposables) => {
|
||||
this._callbacks.add(listener, thisArg);
|
||||
const result = {
|
||||
dispose: () => {
|
||||
this._callbacks.remove(listener, thisArg);
|
||||
}
|
||||
};
|
||||
const remove = this._callbacks.add(listener, thisArg);
|
||||
const result = { dispose: remove };
|
||||
if (Array.isArray(disposables)) {
|
||||
disposables.push(result);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user