An IoC implemention for xprofiler.
import { Injectable, Inject } from "@xprofiler/injection";
import { Config } from "./config";
@Injectable()
export class Foo {
@Inject()
private config: Config;
getKmsConfig(@Inject('KMS_KEY') key: string) {
return this.config[key];
}
}
import { Container } from "@xprofiler/injection";
import { Foo, Bar } from "./items";
const container = new Container();
container.set(Foo);
container.set(Bar);
const foo = container.get(Foo);
const bar = container.get(Bar);