Open Romakita opened 1 year ago
@Romakita managed to spend some time updating the code with bumping all new versions and quite a few code refactoring. I did it a little different to what you suggested though. But I did use inject multiple provider
and it works like a charm!
Also I see that some typechecks don't seem to correct i.e. injector.getAll
and inject.getProviders
should accept more than just string
(given that we use symbol
)
Feel free to have a look. I'd welcome all suggestions!
Since v6.129.0, Ts.ED can inject multiple provider on the constructor, by given a token group :)
Here is the doc reference: https://tsed.io/docs/providers.html#inject-many-provider
In you case:
https://github.com/alexdonh/tsed-bee-queue/blob/f662d9e7a4f06f81113314bd3573cd3424ce7a02/src/QueueModule.ts#L25
You need to replace
PROVIDER_TYPE_QUEUE = "queue"
byPROVIDER_TYPE_QUEUE = Symbol("queue")
.Another point, creating registry isn't necessary in this case.
instead of:
Do that:
This code create automatically the provider
PROVIDER_TYPE_QUEUE
type :)