Interface ComponentLifecycleHooks<ServiceType>

Methods (hooks) called by the app runtime during the lifecycle of a component.

interface ComponentLifecycleHooks<
    ServiceType extends ServiceInstance = ServiceInstance,
> {
    activate(context: ComponentContext<ServiceType>): void | Promise<void>;
    deactivate(context: ComponentContext<ServiceType>): void | Promise<void>;
    destroy(): void | Promise<void>;
    init(context: ComponentContext<ServiceType>): void;
    modified(context: ComponentContext<ServiceType>): boolean | void;
}

Type Parameters

Methods

  • Signals the end of the injection phase and that the component instance is ready for use. The app runtime guarantees that service consumers can access the component instance only after activate is called on the instance.

    Parameters

    Returns void | Promise<void>

  • Signals the start of the shutdown process of the component instance. All injected services are still available and the ejection phase starts after this method.

    Parameters

    Returns void | Promise<void>

  • Signals the end of the life of the component instance. All services are ejected before this method.

    Returns void | Promise<void>

  • Signals the start of the injection phase of the component. It is the first method called by the app runtime after the construction of the instance. Services are injected after this method is called.

    Parameters

    Returns void

MMNEPVFCICPMFPCPTTAAATR