method IContainer.resolve
IContainer.resolve<T>(token: string): T

Resolves an instance, constructing it (and its dependencies) as needed.

Type Parameters

The expected service type

Parameters

token: string

The token to resolve

Return Type

The resolved instance

Throws

Error

If the token is unregistered or a dependency cycle is detected

Usage

import { type IContainer } from "common/src/index.ts";