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

Closed
gomin1d opened this issue Sep 13, 2024 · 1 comment
Closed

How to initialize all services without getting? #1581

gomin1d opened this issue Sep 13, 2024 · 1 comment

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?

@notaphplover
Copy link
Member

You should get them to initialize them. There's currently no API method to initialize all the 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

2 participants