Uneventful
    Preparing search index...

    Interface ServiceAccessor<T>

    A configurable access point for a lazily-created service.

    interface ServiceAccessor<T> {
        replace(factory?: ServiceFactory<T>): void;
        set(instance: T): void;
        unset(): void;
        (): T;
    }

    Type Parameters

    • T
    • Return the service's current instance, creating it if necessary

      Returns T

    Index

    Methods

    Methods

    • Change the factory used to create the instance, or reset to the original/default factory if none given. Does not remove the current cached instance, if any: use unset() as well if you want it recreated on the next access.

      Parameters

      Returns void

    • Replace the active service instance for future lookups

      Parameters

      • instance: T

      Returns void

    • Drop the active instance, to be recreated on demand

      Returns void