The Emitter can be used to expose an Event to the public to fire it from the insides. Sample: class Document {
private readonly _onDidChange = new Emitter<(value:string)=>any>();
public onDidChange = this._onDidChange.event;
// getter-style // get onDidChange(): Event<(value:string)=>any> { // return this._onDidChange.event; // }
private _doIt() { //... this._onDidChange.fire(value); } }
For the public to allow to subscribe to events from this Emitter
To be kept private to fire an event to subscribers
Generated using TypeDoc
The Emitter can be used to expose an Event to the public to fire it from the insides. Sample: class Document {
private readonly _onDidChange = new Emitter<(value:string)=>any>();
public onDidChange = this._onDidChange.event;
// getter-style // get onDidChange(): Event<(value:string)=>any> { // return this._onDidChange.event; // }
private _doIt() { //... this._onDidChange.fire(value); } }