Files
ms365-electron/app/store.js

22 lines
433 B
JavaScript
Raw Normal View History

const Store = require("electron-store");
const store = new Store();
function getValue(key) {
return store.get(key);
}
function setValue(key, value) {
store.set(key, value);
}
function getValueOrDefault(key, defaultValue) {
const value = store.get(key);
if (value === undefined) {
store.set(key, defaultValue);
return defaultValue;
}
return value;
}
module.exports = { getValue, setValue, getValueOrDefault };