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

x/lambda_ioc/lambda-ioc/deno/index.ts>func

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

Given a function, and a list of named dependencies, creates a new dependency factory that will resolve a parameterless function wrapping the original function and its resolved dependencies.

Type Parameters

TParams extends readonly unknown[]
TReturn
TSyncDependencies extends ParamsToResolverKeys<TParams>

Parameters

fn: (...args: TParams) => Awaited<TReturn>

Returns

SyncDependencyFactory<() => TReturn, SyncFuncContainer<TParams, TSyncDependencies>>