Nest: Possibility of ClientsModule.registerAsync

Created on 11 Feb 2020  ·  14Comments  ·  Source: nestjs/nest

Feature Request

Is your feature request related to a problem? Please describe.

Currently i have to write static values into ClientModule.register().
I would like to inject my ConfigModule and read values from there.

Describe the solution you'd like

Make a ClientsModule.registerAsync(). Like the TypeormModule / HttpModule / ...

Teachability, Documentation, Adoption, Migration Strategy

The registerAsync is a very common pattern in nestjs.

What is the motivation / use case for changing the behavior?

Make values configurable thorugh other Modules or services. No need for static typed values.

That would help me a lot.
Thank you for your awesome product!

microservices type

Most helpful comment

Im going to work on this one, because i need this feature. Hope i do it right.

All 14 comments

Is anyone working on this? I can give it a shot if not

@jmcdo29 PR would be more than welcome :)

@jmcdo29 would be great. If you need help, let me know.

What would be the main difference in creating a ClientsModule.registerAsync() vs using a Custom Provider that uses a factory as shown in the docs?

@jmcdo29 I'm guessing it's just all about the consistency with other @nestjs/ modules. Using a custom provider approach would work fine in this case as well :)

To anyone who would like to take a crack at this, it'll be a while before I can get back to it, so feel free 😸

Im going to work on this one, because i need this feature. Hope i do it right.

Any update?

Hi @Hexenon , how's it going now? Help needed?

Hi @Hexenon , how's it going now? Help needed?

i have lot of work i started it and researching how to achieve it, wanna join ?

i have lot of work i started it and researching how to achieve it, wanna join ?

Sounds great! Is there any task that can be split?

i have lot of work i started it and researching how to achieve it, wanna join ?

Sounds great! Is there any task that can be split?

first of all, research how ClientsModule factory works, and understand how providers can be returned asynchronously within NestJS provider factory and what other methods are in there to dynamically return providers or modules

i have lot of work i started it and researching how to achieve it, wanna join ?

Sounds great! Is there any task that can be split?

first of all, research how ClientsModule factory works, and understand how providers can be returned asynchronously within NestJS provider factory and what other methods are in there to dynamically return providers or modules

I made a Pull Request according to your prompt. Would you please give a review?

i have lot of work i started it and researching how to achieve it, wanna join ?

Sounds great! Is there any task that can be split?

first of all, research how ClientsModule factory works, and understand how providers can be returned asynchronously within NestJS provider factory and what other methods are in there to dynamically return providers or modules

I made a Pull Request according to your prompt. Would you please give a review?

good job, all makes sense to me. Its exactly what I was in my wip fork. now let's wait until they review and merge.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tronginc picture tronginc  ·  3Comments

menme95 picture menme95  ·  3Comments

FranciZ picture FranciZ  ·  3Comments

marshall007 picture marshall007  ·  3Comments

anyx picture anyx  ·  3Comments