You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Did you consider adding support for async factories?
This is how an async factory might be used:
classServer{publicasyncinit(){}}asyncfunctionserverFactory(){constserver=newServer();awaitserver.init();returnserver;}classApp{publicstaticinject=['server'];constructor(privateserver: Server){// server is already initialized}}constinjector=createInjector().provideFactory('server',serverFactory);constapp=awaitinjector.injectClass(App);
The text was updated successfully, but these errors were encountered:
Yeah, this would be a great addition. Have thought about it, sure can be added, just haven't got around to it yet.
I find your solution elegant. I was thinking about adding provideAsyncFactory, but if we could add it with the existing provideFactory that would be better.
Did you consider adding support for async factories?
This is how an async factory might be used:
The text was updated successfully, but these errors were encountered: