0.0.10 • Published 8 years ago

nintrajs v0.0.10

Weekly downloads
4
License
MIT
Repository
github
Last release
8 years ago

nintrajs

Nintrajs is a dependency injection and dependency resolver framework based on the intravenous framework written by Roy Jacobs.

create a module

import {Module, Types} from 'nintrajs'
import MyService from '../MyService'

class StandardInjectionModule extends Module {

    constructor() {
        super();
    }

    initialize() {
        this._registerServices();
    }

    getBindings(){
        return super.getBindings();
    }

    _registerServices() {
        this._addBinding('MyService', MyService, Types.Singleton);
    }

    _addBinding(name,type,bindingType) {
        return super._addBinding(name,type,bindingType);
    }
}

export default StandardInjectionModule;

use the dependency resolver

import {DependencyResolver} from 'nintrajs'
import StandardInjectionModule from './injection/StandardInjectionModule'

let standardModule = new StandardInjectionModule();
DependencyResolver.initialize(standardModule)
    .then(() => {
        let myService = DependencyResolver.get('MyService');
    });
0.0.10

8 years ago

0.0.9

8 years ago

0.0.7

8 years ago

0.0.6

9 years ago

0.0.5

9 years ago

0.0.4

9 years ago

0.0.3

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago