Skip to main content
This release is 2 versions behind 0.2.1 — the latest version of @findhow/container. Jump to latest

Built and signed on GitHub Actions

Wasn't a fan of using decorators to dependency inject things in the TypeScript world. Now you don't have to.

This package works with Node.js, DenoIt is unknown whether this package works with Cloudflare Workers, Bun, Browsers
It is unknown whether this package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
It is unknown whether this package works with Bun
It is unknown whether this package works with Browsers
JSR Score
100%
Published
a week ago (0.1.0)
interface ContextualBindingBuilder

Interface for defining contextual bindings in the container. This allows you to define what a concrete type should be given when a specific abstract type is needed.

Methods

needs(abstract: Abstract): this
give(implementation: (() => any) | Abstract): void
giveTagged(tag: string): void
giveConfig(
key: string,
defaultValue?: any,
): void

Add Package

deno add jsr:@findhow/container

Import symbol

import { type ContextualBindingBuilder } from "@findhow/container/container";

---- OR ----

Import directly with a jsr specifier

import { type ContextualBindingBuilder } from "jsr:@findhow/container/container";

Add Package

npx jsr add @findhow/container

Import symbol

import { type ContextualBindingBuilder } from "@findhow/container/container";

Add Package

yarn dlx jsr add @findhow/container

Import symbol

import { type ContextualBindingBuilder } from "@findhow/container/container";

Add Package

pnpm dlx jsr add @findhow/container

Import symbol

import { type ContextualBindingBuilder } from "@findhow/container/container";

Add Package

bunx jsr add @findhow/container

Import symbol

import { type ContextualBindingBuilder } from "@findhow/container/container";