Skip to content

Files

Latest commit

25ab1d4 · Jan 5, 2024

History

History
43 lines (28 loc) · 1.35 KB

Event.md

File metadata and controls

43 lines (28 loc) · 1.35 KB

Interface: Event<T>

Represents a typed event.

A function that represents an event to which you subscribe by calling it with a listener function as argument.

Example

item.onDidChange(function (event) {
  console.log('Event happened: ' + event);
});

Type parameters

Name
T

Callable

Event

Event(listener, thisArgs?, disposables?): Disposable

A function that represents an event to which you subscribe by calling it with a listener function as argument.

Parameters

Name Type Description
listener (e: T) => any The listener function will be called when the event happens.
thisArgs? any The this-argument which will be used when calling the event listener.
disposables? Disposable[] An array to which a Disposable will be added.

Returns

Disposable

A disposable which unsubscribes the event listener.