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

Implement asynchronous injection with async factories #107

Open
basedalexander opened this issue Nov 3, 2018 · 1 comment
Open

Implement asynchronous injection with async factories #107

basedalexander opened this issue Nov 3, 2018 · 1 comment

Comments

@basedalexander
Copy link
Member

basedalexander commented Nov 3, 2018

The idea is to add ability of injecting stuff asynchronously. The syntax example:

{ 
      token: 'IConfig',
      useFactory: async (service: any) => {
              const something = await.service.getSomething();
              return something;
      },
     inject: [Service]
}
@andrei-tatar
Copy link

andrei-tatar commented Dec 6, 2018

Does that mean resolve would always return a promise?
Or do you plan on adding a resolveAsync (in which case the consumer should know if the dependencies are resolved asyn)?

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

No branches or pull requests

2 participants