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

x/lambda_ioc/lambda-ioc/deno/combinators.ts>asyncSingleton

Super type safe dependency injection 💉 for TypeScript (inspired by Diddly)
Latest
function asyncSingleton
import { asyncSingleton } from "https://deno.land/x/lambda_ioc@1.0.0/lambda-ioc/deno/combinators.ts";

Given a dependency factory, returns a new asynchronous factory that will always resolve the same instance of the dependency.

Type Parameters

TVal
TSyncDependencies extends Record<ContainerKey, unknown>
TAsyncDependencies extends Record<ContainerKey, unknown>