1.0.5 • Published 2 years ago

teys-injector v1.0.5

Weekly downloads
2
License
MIT
Repository
github
Last release
2 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

2 years ago

1.0.4

2 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

6 years ago

1.0.0

6 years ago