mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-10 10:11:46 +00:00
31 lines
609 B
JavaScript
31 lines
609 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) => {
|
|
return store.get(key);
|
|
};
|
|
|
|
module.exports = {
|
|
defaultConfig,
|
|
get,
|
|
set,
|
|
setMenuOption,
|
|
edit: () => store.openInEditor(),
|
|
watch: (cb) => {
|
|
store.onDidChange("options", cb);
|
|
store.onDidChange("plugins", cb);
|
|
},
|
|
plugins,
|
|
};
|