Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(feature) add module asynchronous config using factory/existing/class #65

Merged
merged 3 commits into from
Nov 9, 2020

Conversation

ksivamuthu
Copy link
Contributor

@ksivamuthu ksivamuthu commented Nov 15, 2019

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[x] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Other... Please describe:

What is the current behavior?

Added the async configuration method to the module, so that the azure table storage options can be injected into the module using a provider or factory.

Issue Number: #36

What is the new behavior?

The new behavior is

const storageConfigFactory = async () => {
  sasKey: process.env['AZURE_STORAGE_SAS_KEY'],
  accountName: process.env['AZURE_STORAGE_ACCOUNT'],
  containerName: 'nest-demo-container',
};

@Module({
  controllers: [AppController],
  providers: [AppService],
  imports: [
    AzureStorageModule.withConfigAsync({
      useFactory: storageConfigFactory,
    }),
  ],
})
export class AppModule {}

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

@ksivamuthu ksivamuthu changed the title Add asynchronous config methods using factory or existing class (feature) add module asynchronous config using factory/existing/class Nov 15, 2019
@kurpav
Copy link

kurpav commented Mar 3, 2020

Any plans to merge it?

@ksivamuthu
Copy link
Contributor Author

@kamilmysliwiec @manekinekko Any plans on merging this?

@lukazlatecan
Copy link

Any news on this?

@manekinekko manekinekko merged commit 58a8710 into nestjs:master Nov 9, 2020
@manekinekko
Copy link
Collaborator

Thank you @ksivamuthu for sending this PR.

@gergelybodor
Copy link

When will this be released to npm? The latest version which is 2.1.1 doesn't have this feature.

@stijnswaanen
Copy link

yes, can this please be released to npm asap? Thx

@f5hajnal
Copy link

I was able to properly incorporate this to my project as a "helper" module. It works like a charm. However it would be amazing to see this be actually shipped to the latest npm version of the package... More than 6 months now since it's approval.
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants