@acceleratxr/core_sdk / ServiceFactory

Class: ServiceFactory#

The ServiceFactory is responsible for managing instances of all Service classes used to perform operations on a given data model type.

Hierarchy#

  • ServiceFactory

Index#

Constructors#

Properties#

Methods#

Constructors#

constructor#

+ new ServiceFactory(apiClient: ApiClient, config: Configuration): ServiceFactory

Defined in src/ServiceFactory.ts:18

Initializes the ServiceFactory with the specified api client and configuration.

Parameters:#

Name

Type

Description

apiClient

ApiClient

The API Client used when making requests to the API backend server.

config

Configuration

The configuration to initialize the factory with.

Returns: ServiceFactory

Properties#

apiClient#

Private apiClient: ApiClient

Defined in src/ServiceFactory.ts:16


config#

Private config: Configuration

Defined in src/ServiceFactory.ts:17


services#

Private services: Map<any, any> = new Map()

Defined in src/ServiceFactory.ts:18

Methods#

getService#

getService<T>(type: {}): T

Defined in src/ServiceFactory.ts:36

Retrieves the Service class instance of the desired type.

Type parameters:#

Name

T

Parameters:#

Name

Type

Description

type

{}

The type of Service class to retrieve an instance of.

Returns: T

The instance of the desired Service class.