1.0.1 • Published 1 year ago

anti-di v1.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

Anti DI

Tiny, easy to use IoC Dependency Injection container made for Typescript/Javascript

No container declaration. No Reflect Metadata. No unnecessary decorators. No over the top features. Simple Static Singleton Pattern.

Usage

// Extend Injectable to make a class Injectable
export class MyClass extends Injectable {
    ...
}

// Use Injectable class
export class UserService {
    private readonly myClass = MyClass.getInstance<MyClass>(MyClass);
}

It only supports property injection which is enough for most use cases. For constructor based injection checkout tsyringe, inversify, typedi.

It uses inheritance to maintain references inside the object so you don't have to maintain containers separately.

1.0.1

1 year ago

1.0.0

1 year ago