remove usage of EventSource in favour of Event & Emitter (fixes #1522)

This commit is contained in:
Benjamin Pasero
2015-12-21 15:32:05 +01:00
parent 263a9551b7
commit 63f8136c51
33 changed files with 128 additions and 133 deletions

View File

@@ -11,9 +11,8 @@ import path = require('path');
import json = require('vs/base/common/json');
import objects = require('vs/base/common/objects');
import {EventProvider} from 'vs/base/common/eventProvider';
import {TPromise} from 'vs/base/common/winjs.base';
import {EventSource} from 'vs/base/common/eventSource';
import Event, {Emitter} from 'vs/base/common/event';
import {IWorkspaceContextService} from 'vs/workbench/services/workspace/common/contextService';
export interface ISettings {
@@ -33,12 +32,12 @@ export class UserSettings {
private appSettingsPath: string;
private appKeybindingsPath: string;
private _onChange: EventSource<(settings: ISettings) => void>;
private _onChange: Emitter<ISettings>;
constructor(appSettingsPath: string, appKeybindingsPath: string) {
this.appSettingsPath = appSettingsPath;
this.appKeybindingsPath = appKeybindingsPath;
this._onChange = new EventSource<(settings: ISettings) => void>();
this._onChange = new Emitter<ISettings>();
this.registerWatchers();
}
@@ -67,8 +66,8 @@ export class UserSettings {
});
}
public get onChange(): EventProvider<(settings: ISettings) => void> {
return this._onChange.value;
public get onChange(): Event<ISettings> {
return this._onChange.event;
}
public getValue(key: string, fallback?: any): any {