@prodigylabs/identity-core-config
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

Info

Core module which provides a common functionality like dependency injection, logging, error handling

Dependency Injection

Key points:

  1. We use node-dependency-injection as a dependency injection engine
  2. Dependency injection is resolved automatically, all you need to have is to add injections.yml, similar to this
services:
    controller.index:
        class: ./controllers/index.controller

It will create a class located in ./controllers/index.controller.ts and store it by this key controller.index 3. If it is necessary, injected dependency can be retrieved next way

import {injector} from 'identity-core-common';
... // Not relevant code omitted for clarity
let indexController: IndexController = injector.get('controller.index');
... // Not relevant code omitted for clarity

Note

Such way of dependency injection resembles more service locator pattern with all of it advantages and disadvantages, but gives an effective and simple way to decouple dependency injection from the codebase

Readme

Keywords

none

Package Sidebar

Install

npm i @prodigylabs/identity-core-config

Weekly Downloads

1

Version

0.0.1

License

MIT

Unpacked Size

3.62 kB

Total Files

14

Last publish

Collaborators

  • bnannier