Skip to main content

Class: Disposable

Extended by

Constructors

new Disposable()

new Disposable(func): Disposable

Parameters

func

Returns

Disposable

Source

packages/extension-api/src/extension-api.d.ts:85

new Disposable()

new Disposable(callOnDispose): Disposable

Creates a new Disposable calling the provided function on dispose.

Parameters

callOnDispose: Function

Function that disposes something.

Returns

Disposable

Source

packages/extension-api/src/extension-api.d.ts:92

Methods

dispose()

dispose(): void

Dispose this object.

Returns

void

Source

packages/extension-api/src/extension-api.d.ts:97


create()

static create(func): Disposable

Parameters

func

Returns

Disposable

Source

packages/extension-api/src/extension-api.d.ts:99


from()

static from(...disposableLikes): Disposable

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.

Source

packages/extension-api/src/extension-api.d.ts:111