Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Emitter<T>

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); } }

Type parameters

  • T

Hierarchy

Index

Constructors

Accessors

Methods

Constructors

constructor

Accessors

event

  • For the public to allow to subscribe to events from this Emitter

    Returns Event<T>

Methods

dispose

  • dispose(): void
  • Returns void

fire

  • fire(event: T): void
  • To be kept private to fire an event to subscribers

    Parameters

    • event: T

    Returns void

Generated using TypeDoc