Feat(base config builder): allow async overrides #2177
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why
This PR introduces changes to the
BaseConfigBuilder
class in the@equinor/fusion-framework
package. The current behavior of theBaseConfigBuilder
class is that it provides a way to build and configure modules by defining configuration callbacks for different parts of the module's configuration. However, the implementation has some limitations and lacks proper documentation.The new behavior introduced by this PR is an improved and more flexible implementation of the
BaseConfigBuilder
class. It includes better handling of nested configurations, improved type safety, and more comprehensive documentation. Additionally, it introduces new helper methods for working with configuration callbacks and adds examples to illustrate the usage of the class.This PR does not introduce any breaking changes, as it maintains backward compatibility with the existing API.
Changes
BaseConfigBuilder
class, including a detailed example of how to use it._get
and_has
to retrieve and check for the existence of configuration callbacks._createConfig
to useswitchMap
instead ofmergeMap
for better handling of asynchronous operations._buildConfig
method to use more descriptive comments and better variable naming._processConfig
method to illustrate how it can be used for post-processing and validating the configuration.Benefits
BaseConfigBuilder
class.Check off the following: