Interface ComponentInstanceFactory<ServiceType>

Interface which must be implemented by an component implementation when the flag instanceFactory is set to true. Then the component is a factory which creates a service implementation.

interface ComponentInstanceFactory<ServiceType> {
    createInstance(): ServiceType;
    destroyInstance?(instance): void | Promise<void>;
}

Type Parameters

Methods

  • Creates a new service instance. The returned service instance is registered as a service at the app runtime.

    Returns ServiceType

  • Cleans up the service instance during shutdown.

    Parameters

    Returns void | Promise<void>

Generated using TypeDoc