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.

clear(context: IContext): Promise<void>

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

Examples

	type MyObjectWithState {
			_state any
		}
		...
		func (mo *MyObjectWithState) clear(ctx context.Context) {
			mo._state = any
		}

See also