Open davidbayo10 opened 4 years ago
Just had the same problem. You'll get a Promise if you use it like this. I solved it like this
const messenger = await Messenger.create(uri, serviceName, ttl)
Container
.bind(Messenger)
.factory(() => messenger)
.scope(Scope.Singleton)
Works for me because im in a async function while using await
Any update on this ?
Just had the same problem. You'll get a Promise if you use it like this. I solved it like this
const messenger = await Messenger.create(uri, serviceName, ttl) Container .bind(Messenger) .factory(() => messenger) .scope(Scope.Singleton)
Works for me because im in a async function while using await
I prefer to use @Inject into property classes
Any update on this ?
I think this repo is not maintained...
I'm using async-injection instead of this one.
Hi all! I want to perform this factory class behaviour, but when I call
new S()
, a promise is returned. Do I do something wrong? May this feature is not present for being used as factory?Thank you all in advance!