Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

Usage

import * as minimalInjector from "https://raw.githubusercontent.com/drmercer/minimal-injector/master/injector.ts";

§Functions

injectable

Creates a new injectable (a "module" or "component" that can be obtained from an Injector), returning a new InjectKey that maps to that injectable.

makeInjector

Creates a new dependency injector (an Injector) that uses the given overrides.

override

A utility for creating new Overrides. Using this function (without explicit type params) ensures that b is actually assignable to a.

§Interfaces

InjectKey

A key for an injectable dependency. Can be exchanged for a T (the dependency itself) via an Injector.

§Type Aliases

InjectedValue

A utility type that evaluates to the "T" given an InjectKey. This allows you to do things like:

Injector

A function that takes an InjectKey and returns the value that key is mapped to, constructing the value if necessary.

Override

Specifies that overrider should be used when overridden is requested from this injector.