Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to initialize all services without getting? #1581

Open
gomin1d opened this issue Sep 13, 2024 · 0 comments
Open

How to initialize all services without getting? #1581

gomin1d opened this issue Sep 13, 2024 · 0 comments

Comments

@gomin1d
Copy link

gomin1d commented Sep 13, 2024

My program:

import "reflect-metadata";
import { Container } from "inversify";
import { DbService } from "@/service/db/db-service";
import { ExpressService } from "@/service/express/express-service";
import { SignUpService } from "@/service/signup/sign-up-service";
import { ProfileService } from "@/service/profile/profile-service";

let container = new Container({ defaultScope: "Singleton" });

container.bind(DbService).toSelf();
container.bind(ExpressService).toSelf();
container.bind(SignUpService).toSelf();
container.bind(ProfileService).toSelf();

But these services are not initialized until I get them via container.get*. How do I cause the initialization of ALL services?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant