ioc

extremely simple container that loosely aligns to IOC

MIT License

Downloads
1.4K
Stars
1

ioc

extremely simple container that loosely aligns to IOC

Usage

Installation

$ npm install @travi/ioc -S

Making an instance available through the container

import {register} from '@travi/ioc';

const instance = factory();

add('instance-name', instance);

Getting an instance from the container

import {use} from '@travi/ioc';

const instance = use('instance-name');