rob3000 / nestjs-kafka

NestJS integration with KafkaJS
The Unlicense
130 stars 44 forks source link

[Feature] Asynchronous Module Initialization #12

Closed Shamshiel closed 3 years ago

Shamshiel commented 3 years ago

Implemented "Asynchronous Module Initialization" with the help of this article: https://dev.to/nestjs/advanced-nestjs-how-to-build-completely-dynamic-nestjs-modules-1370

Added some new files and extended the existing code. Didn't change any logic in the old register() method or in any other file. Couldn't come up with a better way of the initialization of registerAsync() without changing existing code. It is only a slight inconvenience to provide the name of the service (e.g. "HERO_SERVICE") twice. I added a new example to the readme.md.

Added e2e tests for the new registerAsync() method and tried to reduce duplicated code in the test section as much as possible.

rob3000 commented 3 years ago

Nice work! 🥳