We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Please can you address how to handle circular dependencies, with an example if possible.
The text was updated successfully, but these errors were encountered:
You mean something like this?
import { createInjector } from "typed-inject"; class HttpClient { public static inject = ["logger"] as const; public service?: MyService; } class MyService { constructor(private http: HttpClient) { http.service = this; // Assign circular dependency } public static inject = ["httpClient"] as const; } const appInjector = createInjector().provideClass("httpClient", HttpClient); const myService = appInjector.injectClass(MyService);
If not, please try to explain with a code example.
Sorry, something went wrong.
@nicojs I was asking for something more like a direct dependency between two services, or dependency through a third service.
A -> B -> A A -> B -> C -> A
I don't have a concrete example at the moment, just trying to assess potentials of different IOC libraries.
No branches or pull requests
Please can you address how to handle circular dependencies, with an example if possible.
The text was updated successfully, but these errors were encountered: