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 a component’s state.

Future clear(IContext? context)

  • context: IContext - (optional) a context to trace execution through a call chain.

Examples

class MyObjectWithState implements ICleanable {
    dynamic _state = {};
    ...
    Future clear(IContext? context) {
       _state = {};
       return  Future();
    }
}

See also