closeOne static method

Future closeOne(
  1. IContext? context,
  2. dynamic component
)

Closes specific component.

To be closed components must implement ICloseable interface. If they don't the call to this method has no effect.

  • context (optional) a context to trace execution through call chain.
  • component the component that is to be closed. Retrun Future that receives error or null no errors occured.

See IClosable

Implementation

static Future closeOne(IContext? context, component) async {
  if (component is IClosable) await component.close(context);
}