Skip to content

Documentation / base / IDisposable

Interface: IDisposable

Defined in: libs/base/src/ref.ts:8

Represents an object that can be disposed

Extends

Properties

[EventMapType]?

readonly optional [EventMapType]?: object

Defined in: libs/base/src/event.ts:54

Type-only event map marker.

dispose

dispose: []

Inherited from

IEventTarget.[EventMapType]


disposed

readonly disposed: boolean

Defined in: libs/base/src/ref.ts:10

Methods

on()

on<K>(type, listener, context?): void

Defined in: libs/base/src/event.ts:61

Sets up a function that will be called whenever the specified event is delivered to the target

Type Parameters

K

K extends "dispose"

Parameters

type

K

The event type to listen for

listener

EventListener<{ dispose: []; }, K>

The callback function

context?

unknown

Context object of the listener function

Returns

void

Inherited from

IEventTarget.on


once()

once<K>(type, listener, context?): void

Defined in: libs/base/src/event.ts:68

Sets up a function that will be called only once when the specified event is delivered to the target

Type Parameters

K

K extends "dispose"

Parameters

type

K

The event type to listen for

listener

EventListener<{ dispose: []; }, K>

The callback function

context?

unknown

Context object of the listener function

Returns

void

Inherited from

IEventTarget.once


off()

off<K>(type, listener?, context?): void

Defined in: libs/base/src/event.ts:74

Removes an event listener function previously registered.

Type Parameters

K

K extends "dispose"

Parameters

type

K

The event type for which to remove an event listener

listener?

EventListener<{ dispose: []; }>

The callback function to be removed

context?

unknown

Returns

void

Inherited from

IEventTarget.off


dispatchEvent()

dispatchEvent<K>(type, ...args): void

Defined in: libs/base/src/event.ts:80

Synchronously invoke the affected event listeners with an event object

Type Parameters

K

K extends "dispose"

Parameters

type

K

args

...object[K]

Returns

void

false if the event was canceled, otherwise true

Inherited from

IEventTarget.dispatchEvent


dispose()

dispose(): void

Defined in: libs/base/src/ref.ts:9

Returns

void

Released under the MIT License.