3.0.2 • Published 5 years ago

di-helper v3.0.2

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

di-helper

A concise JavaScript dependency injector

import { provide } from 'di-helper';

provide('logger').as(console.log);

// ...

import { using } from 'di-helper';

const greet = using((['logger'], (log, name) => {
  log(`Hello ${name}!`);
});

greet('world');

Usage

Install

di-heper is built into UMD package, which supports both ESM, CommonJS, etc..

// Default instance and its methods
import { context, provide, resolve, resolveAll, using } from 'di-helper';
const { context, provide, resolve, resolveAll, using } = require('di-helper');

// Context class
import { Context } from 'di-helper';
const { Context } = require('di-helper');

API

See API documentation.

3.0.2

5 years ago

3.0.1

5 years ago

3.0.0

5 years ago

2.2.0

5 years ago

2.1.3

5 years ago

2.1.2

5 years ago

2.1.1

5 years ago

2.1.0

5 years ago

2.0.2

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.0

6 years ago