mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-09 01:31:46 +00:00
32 lines
617 B
JavaScript
32 lines
617 B
JavaScript
const defaultConfig = require('./defaults');
|
|
const plugins = require('./plugins');
|
|
const store = require('./store');
|
|
|
|
const { restart } = require('../providers/app-controls');
|
|
|
|
const set = (key, value) => {
|
|
store.set(key, value);
|
|
};
|
|
|
|
function setMenuOption(key, value) {
|
|
set(key, value);
|
|
if (store.get('options.restartOnConfigChanges')) {
|
|
restart();
|
|
}
|
|
}
|
|
|
|
const get = (key) => store.get(key);
|
|
|
|
module.exports = {
|
|
defaultConfig,
|
|
get,
|
|
set,
|
|
setMenuOption,
|
|
edit: () => store.openInEditor(),
|
|
watch(cb) {
|
|
store.onDidChange('options', cb);
|
|
store.onDidChange('plugins', cb);
|
|
},
|
|
plugins,
|
|
};
|