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

Proxied object #156

Closed
Richienb opened this issue Nov 14, 2021 · 1 comment
Closed

Proxied object #156

Richienb opened this issue Nov 14, 2021 · 1 comment

Comments

@Richienb
Copy link
Contributor

Would be nice if conf provided a proxy that allows the config to be accessed and set more easily. For example:

const {store} = new Conf();

store.a = 2;
store.a++;

console.log(store.a);
//=> 3

We'd probably need to assign it to a different name though.

@sindresorhus
Copy link
Owner

I did consider it in the past, but I decided not to as it would hide the fact that each mutation is a fairly expensive method call.

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

2 participants