Backstage
    Preparing search index...

    Interface RootServiceFactoryOptions<TService, TInstances, TImpl, TDeps>

    interface RootServiceFactoryOptions<
        TService,
        TInstances extends "singleton" | "multiton",
        TImpl extends TService,
        TDeps extends { [name in string]: ServiceRef<unknown> },
    > {
        deps: TDeps;
        initialization?: "always" | "lazy";
        service: ServiceRef<TService, "root", TInstances>;
        factory(
            deps: ServiceRefsToInstances<TDeps, "root">,
        ): TImpl | Promise<TImpl>;
    }

    Type Parameters

    • TService
    • TInstances extends "singleton" | "multiton"
    • TImpl extends TService
    • TDeps extends { [name in string]: ServiceRef<unknown> }
    Index

    Properties

    deps: TDeps
    initialization?: "always" | "lazy"

    The initialization strategy for the service factory. This service is root scoped and will use always by default.

    • always - The service will always be initialized regardless if it is used or not.
    • lazy - The service will only be initialized if it is depended on by a different service or feature.

    Service factories for root scoped services use always as the default, while plugin scoped services use lazy.

    service: ServiceRef<TService, "root", TInstances>

    Methods