Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/hex/src/mod.ts>di.containers.Container

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

Type Parameters

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

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