tsbase
    Preparing search index...

    Interface IContainer<T>

    A light weight inversion of control (IOC) container

    interface IContainer<T> {
        Get<D>(dependency: (t: T) => D): D;
        Init(t: T): void;
    }

    Type Parameters

    • T

    Implemented by

    Index

    Methods

    Methods

    • Retrieve the desired dependency through type safe lambda syntax

      Type Parameters

      • D

      Parameters

      • dependency: (t: T) => D

        Selection function for the desired dependency

      Returns D

    • Set the dependencies to be managed by the Container Call this method outside the module which constructs the Container instance in order to preserve inversion.

      Parameters

      • t: T

        Concrete dependencies conforming to abstractions in T

      Returns void