Skip to main content
Module

x/hex/mod.ts>di.Container

An ecosystem delivering practices, philosophy and portability.
Go to Latest
interface di.Container
Re-export
import { type di } from "https://deno.land/x/hex@0.5.15/mod.ts";
const { Container } = di;

Type Parameters

optional
K = Class | symbol | string
optional
V = any

Properties

items: ContainerItems<K, V>

Methods

get<V2 = V>(token: K, defaultValue?: V2): Promise<V2 | undefined> | V2 | undefined
getMany<K2 extends string | number | symbol>(...tokens: K2[]): Promise<Record<K2, V | undefined>> | Record<K2, V | undefined>
setValue(token: K, value: V): void
setValueLazy(token: K, value: () => V | undefined): void
setFactory(token: K, value: () => V | undefined): void