mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-27 20:13:32 +01:00
remove usage of EventSource in favour of Event & Emitter (fixes #1522)
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user