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

Ability to chain configuration and dependencies #16

Open
kamaz opened this issue Jan 27, 2021 · 0 comments
Open

Ability to chain configuration and dependencies #16

kamaz opened this issue Jan 27, 2021 · 0 comments
Labels

Comments

@kamaz
Copy link
Contributor

kamaz commented Jan 27, 2021

At the moment we don't have an example but I can image in future we may a configuration/dependencies that depends on other configuration for example:

const config1 = getConfig1()
const config2= getConfig2(config)

We could do that in a function at the moment and have a result:

config(() => {
   const config1 = getConfig1()
    const config2= getConfig2(config)
    return {config1, config2}
})

but it would be good to have the ability to chain them in following format:

config(() => {
   config1: getConfig1()
}).config((config) => {
   config2: getConfig2(config.config1)
})

or event something like that

type getConfig1Object = () => {config1: string}
type getConfig2Object = (config1: string) => () => {config2: string}

config(getConfig1Object)
.config(getConfig2Object)

and at the end that

@kamaz kamaz added the proposal label Jan 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant