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

feat(module): add forRootAsync method for dynamic configuration #1918

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

masterj3y
Copy link

PR Checklist

Please check if your PR fulfills the following requirements:


PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe: Refactor for async provider configuration in CQRS module

What is the current behavior?

Issue Number: 1912

  • The CQRS module was not dynamically configurable with useFactory to inject dependencies.

What is the new behavior?

  • Refactored the CqrsModule to support dynamic async provider configuration using useFactory.
  • Added the ability to inject dependencies into the factory function and make CQRS_MODULE_OPTIONS configurable.
  • Ensured that CQRS_MODULE_OPTIONS can be injected from a separate module if required, improving modularity and flexibility.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

  • This update ensures that configuration options for the CQRS module can be set asynchronously, which allows for more flexible and scalable configuration, especially in dynamic environments

}

throw new Error(
'Invalid CqrsModuleAsyncOptions configuration. Provide useFactory.',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about useClass and useValue?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Support for useClass, useValue and useExisting has been added.

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.

2 participants