How to use the electron-json-storage.getMany function in electron-json-storage

To help you get started, we’ve selected a few electron-json-storage examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github innFactory / aws-session-token-gui / app / store / configureStore.prod.js View on Github external
function loadInitialState(callback) {
  storage.getMany(['config', 'user'], function (error, data) {
    if (error) { console.log(error) };
    if (data) {
      _configureStore(data, callback);
    }
  });
}
github innFactory / aws-session-token-gui / app / store / configureStore.dev.js View on Github external
function loadInitialState(callback) {
  storage.getMany(['config', 'user'], function(error, data) {
  if (error){console.log(error)};
  if (data) {
    _configureStore(data, callback);
  }
});
}
github pumPCin / GiveawayJoiner / giveawayjoiner.js View on Github external
loadLangs(callback) {
let _this = this;
if (fs.existsSync(storage.getDataPath())) {
let lng_to_load = [];
let dir = fs.readdirSync(storage.getDataPath());
for (let x = 0; x < dir.length; x++) {
if (dir[x].indexOf('lang.') >= 0) {
lng_to_load.push(dir[x].replace('.json', ''));
}
}
if (!lng_to_load.length) {
return;
}
storage.getMany(lng_to_load, function (error, langs) {
if (error) throw new Error("Can't load selected translation");
let lng;
for (lng in langs.lang) {
_this.langsCount++;
}
if (langs.lang[Config.get('lang', _this.default)] === undefined) {
_this.default = lng;
Config.set('lang', _this.default);
}
_this.languages = langs.lang;
if (callback) {
callback();
}
});
}
}