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

Set sane defaults for configuration #4

Open
trietsch opened this issue May 5, 2021 · 0 comments
Open

Set sane defaults for configuration #4

trietsch opened this issue May 5, 2021 · 0 comments

Comments

@trietsch
Copy link
Contributor

trietsch commented May 5, 2021

Default values could be set as follows (discussed with @Rachnerd). In the constructor of the Client, defaults could be set using:

    const {
      authUrl = 'url',
      ...other
    } = config;

    this.config = other;

This overrides the config as provided in the constructor, by specifying values for properties in the Config interface, that are nullable. So it's important to update the Config interface, and to make the properties nullable. If a user of the driver provides values for e.g. authUrl, then that value will be used. Otherwise, the ones provided in the const are used.

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

No branches or pull requests

1 participant