Represents an instance with an optional lifecycle method. This interface defines a structure for an object that may optionally include a method to handle clean-up or teardown operations when the instance is no longer needed.

Instance

interface Instance {
    onDestroy(): void;
}

Implemented by

Methods

Methods

  • Optional method to perform teardown or clean-up actions specific to the instance. It is invoked when the instance is being destroyed. This method does not take any parameters and does not return any value.

    Returns void