1.0.5 • Published 3 years ago

teys-injector v1.0.5

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

teys-injector

Simple injector syntax for Typescript code. It allows you to set dependency

import { Injectable, Inject } from "teys-injector";

@Injectable()
class Service {
    
    method1(): boolean {
        return false;
    }
}
import { Inject } from "teys-injector";

class OtherClass {
    
    @Inject()
    svc: Service;
    
    method2() {
        return this.svc.method1();
    }
}

You can also register manually values and resolve them

import { Injector } from "teys-injector";

Injector.Register("user", { username: 'default' });
import { Injector } from "teys-injector";

const defaultUser = Injector.Resolve<User>("user");

Not supported yet

  • Injectable constructor parameters
1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

7 years ago

1.0.0

7 years ago