Skip to main content

Class: Disposable

Defined in: packages/extension-api/src/extension-api.d.ts:90

Extended by

Constructors

new Disposable()

new Disposable(func): Disposable

Defined in: packages/extension-api/src/extension-api.d.ts:91

Parameters

func

() => void

Returns

Disposable

new Disposable()

new Disposable(callOnDispose): Disposable

Defined in: packages/extension-api/src/extension-api.d.ts:98

Creates a new Disposable calling the provided function on dispose.

Parameters

callOnDispose

Function

Function that disposes something.

Returns

Disposable

Methods

dispose()

dispose(): void

Defined in: packages/extension-api/src/extension-api.d.ts:103

Dispose this object.

Returns

void


create()

static create(func): Disposable

Defined in: packages/extension-api/src/extension-api.d.ts:105

Parameters

func

() => void

Returns

Disposable


from()

static from(...disposableLikes): Disposable

Defined in: packages/extension-api/src/extension-api.d.ts:117

Combine many disposable-likes into one. Use this method when having objects with a dispose function which are not instances of Disposable.

Parameters

disposableLikes

...object[]

Objects that have at least a dispose-function member.

Returns

Disposable

Returns a new disposable which, upon dispose, will dispose all provided disposables.