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(context: Optional[IContext])

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

Examples

class MyObjectWithState(ICleanable):
    _state = {}
    ...

    def clear(self, context):
        self._state = {}  

See also