hosanna-ui-docs - v0.9.0
    Preparing search index...

    IoCContainer is responsible for managing service registration and resolution. It supports dependency injection and lazy initialization of services.

    Index

    Constructors

    Properties

    __hs_global: any

    A global platform-specific object, decorated with @platformGlobal.

    serviceMap: Record<string, IOCServiceMapItem> = {}

    A record of service map items, keyed by their unique identifiers.

    services: Record<string, any> = {}

    A record of registered services, keyed by their unique identifiers.

    Methods

    • Creates a service instance from the service map.

      Parameters

      • key: string

        The unique key identifying the service.

      Returns any

      The created service instance.

      Error if the service cannot be created.

    • Registers a service with the specified key.

      Parameters

      • key: string

        The unique key identifying the service.

      • service: any

        The service instance to register.

      Returns void

    • Resolves a service by its key. If the service is not found, it attempts to create it from the service map.

      Type Parameters

      • T

      Parameters

      • key: string

        The unique key identifying the service.

      Returns T

      The resolved service instance.

      Error if the service cannot be found or created.