ICleanable

Interface that allows you to create components with a method to clean their states.

Description

The ICleanable interface allows you to create components with a method to clean their states.

Instance methods

clear

Clears component state.

clear(correlationId: string): Promise<void>

  • correlationId: string - (optional) transaction id to trace execution through call chain.

Examples

class MyObjectWithState implements ICleanable {
    private _state: any = {};
    ...
    public async clear(correlationId: string): void {
        this._state = {};
    }
}

See also