container-ioc
container-ioc copied to clipboard
Implement asynchronous injection with async factories
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]
}
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)?