mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-19 01:25:36 -05:00
Strict Null Checks, Builder Removal, Formatting (#4849)
* remove builder; more null checks * null checks * formatting * wip * fix dropdown themeing * formatting * formatting * fix tests * update what files are checked * add code to help refresh bad nodes
This commit is contained in:
@@ -14,22 +14,21 @@ export class AngularEventingService implements IAngularEventingService {
|
||||
private _angularMap = new Map<string, Subject<IAngularEvent>>();
|
||||
|
||||
public onAngularEvent(uri: string, cb: (event: IAngularEvent) => void): Subscription {
|
||||
let subject: Subject<IAngularEvent>;
|
||||
if (!this._angularMap.has(uri)) {
|
||||
let subject = this._angularMap.get(uri);
|
||||
if (!subject) {
|
||||
subject = new Subject<IAngularEvent>();
|
||||
this._angularMap.set(uri, subject);
|
||||
} else {
|
||||
subject = this._angularMap.get(uri);
|
||||
}
|
||||
let sub = subject.subscribe(cb);
|
||||
return sub;
|
||||
}
|
||||
|
||||
public sendAngularEvent(uri: string, event: AngularEventType, payload?: any): void {
|
||||
if (!this._angularMap.has(uri)) {
|
||||
const subject = this._angularMap.get(uri);
|
||||
if (!subject) {
|
||||
warn('Got request to send an event to a dashboard that has not started listening');
|
||||
} else {
|
||||
this._angularMap.get(uri).next({ event, payload });
|
||||
subject.next({ event, payload });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user