-
-
Notifications
You must be signed in to change notification settings - Fork 148
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
Store.clear() clears ALL stores #243
Comments
Yes as explained in the README :
|
No, it clears the current store, as you can see here: https://github.com/sindresorhus/conf/blob/92320d7e2c9db2c56b05dd654c3a248a635598d2/source/index.ts#L285-L291 |
I think the problem @vothvovo faced is that when you create 2 different stores they will overwrite each other. I assume it's because they share the same config.json file. I tried it myself on this demo project to validate it. const Store = require('electron-store');
const store1 = new Store();
const store2 = new Store();
store1.set('unicorn', '🦄');
store2.set('unicorn', '🦄');
console.log(store1.get('unicorn'));
//=> '🦄'
console.log(store2.get('unicorn'));
//=> '🦄'
store1.clear();
console.log(store1.get('unicorn'));
//=> undefined
console.log(store2.get('unicorn'));
//=> undefined |
Is this intended? I feel like it is unintuitive.
The text was updated successfully, but these errors were encountered: