Represents an item that can be initialized.

interface Initializable {
    isDestroyed: boolean;
    isInitialized: boolean;
    destroy(): Promise<void>;
    initialize(): Promise<void>;
}

Hierarchy (view full)

Implemented by

Properties

isDestroyed: boolean

Indicates if the item has been destroyed. Once destroyed, it is not safe to invoke any other methods on the object.

isInitialized: boolean

Indicates if the item has been initialized.

Methods

  • A clean-up function that should get called whenever the item is disposed of.

    Returns Promise<void>

  • Initializes the item.

    Returns Promise<void>