Add onMultipleOptionChange

This commit is contained in:
Daniel Imms
2022-10-09 08:14:56 -07:00
parent 49a0904857
commit 7eead44048
5 changed files with 62 additions and 0 deletions
+8
View File
@@ -129,6 +129,14 @@ export class MockOptionsService implements IOptionsService {
}
});
}
// eslint-disable-next-line @typescript-eslint/naming-convention
public onMultipleOptionChange(keys: (keyof ITerminalOptions)[], listener: () => any): IDisposable {
return this.onOptionChange(eventKey => {
if (keys.indexOf(eventKey) !== -1) {
listener();
}
});
}
public setOptions(options: ITerminalOptions): void {
for (const key of Object.keys(options)) {
this.options[key] = options[key];