Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

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

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

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