Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface ICleanable

Interface for components that should clean their state.

Cleaning state most often is used during testing. But there may be situations when it can be done in production.

see

Cleaner

Example

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

Hierarchy

  • ICleanable

Index

Methods

Methods

clear

  • clear(correlationId: string, callback?: function): void
  • Clears component state.

    Parameters

    • correlationId: string

      (optional) transaction id to trace execution through call chain.

    • Optional callback: function

      callback function that receives error or null no errors occured.

        • (err: any): void
        • Parameters

          • err: any

          Returns void

    Returns void

Generated using TypeDoc