How to use the store.set function in store

To help you get started, we’ve selected a few store 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 vim-awesome / vim-awesome / web / static / js / app.jsx View on Github external
$.getJSON("/api/plugins/" + this.props.params.slug, function(data) {
      this.setState(data);

      // Save in localStorage that this plugin has been visited.
      if (store.enabled) {
        var pluginStore = store.get("plugin-" + data.slug) || {};
        pluginStore.hasVisited = true;
        store.set("plugin-" + data.slug, pluginStore);
      }
    }.bind(this));
  },
github wanadev / holes-in / debug / js / debug.js View on Github external
debug.elems.submit.addEventListener("click", () => {
            store.set('outerShape', debug.elems.outerShape.value);
            store.set('holes', debug.elems.holes.value);
            store.set('doNotBuild', debug.elems.doNotBuild.value);
            debug.refresh();
            window.location.href = "#page";
        });
github 3box / 3box-js / src / 3id / index.js View on Github external
async _initKeyringByName (name) {
    if (this._has3idProv) throw new Error('Can not initKeyringByName of IdentityWallet')
    if (!this._keyrings[name]) {
      const sig = await utils.openSpaceConsent(this.managementAddress, this._provider, name)
      const entropy = '0x' + utils.sha256(sig.slice(2))
      const seed = mnemonicToSeed(entropyToMnemonic(entropy))
      this._keyrings[name] = new Keyring(seed)
      this._subDIDs[name] = await this._init3ID(name)
      localstorage.set(STORAGE_KEY + this.managementAddress, this.serializeState())
      return true
    } else {
      return false
    }
  }
github idoco / intergram / src / chat / chat-index.js View on Github external
function getUserId () {
    if (store.enabled) {
        return store.get('userId') || store.set('userId', generateRandomId());
    } else {
        return generateRandomId();
    }
}
github wanadev / holes-in / debug / js / debug.js View on Github external
debug.elems.submit.addEventListener("click", () => {
            store.set('outerShape', debug.elems.outerShape.value);
            store.set('holes', debug.elems.holes.value);
            store.set('doNotBuild', debug.elems.doNotBuild.value);
            debug.refresh();
            window.location.href = "#page";
        });
github idoco / intergram / src / chat / chat.js View on Github external
constructor(props) {
        super(props);
        if (store.enabled) {
            this.messagesKey = 'messages' + '.' + props.chatId + '.' + props.host;
            this.state.messages = store.get(this.messagesKey) || store.set(this.messagesKey, []);
        } else {
            this.state.messages = [];
        }
    }
github e-schultz / ng-summit-redux / src / actions / lineup-actions.js View on Github external
function getNextPartyId() {
  let partyId = localStorage.get('partyId');
  partyId = partyId === []._ ? 1 : ++partyId;
  localStorage.set('partyId', partyId);
  return partyId;
}
github mediathekview / mediathekviewweb / client / src / app / settings.ts View on Github external
private static save(namespace: string) {
    for (let key in Settings.cache[namespace]) {
      StoreJS.set(namespace + '_' + key, Settings.cache[namespace][key]);
    }
  }
github tamber / tamber-node / lib / Store.js View on Github external
initGuestId: function(){
		var id = "";
		var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
		for( var i=0; i < 21; i++ ){
			id += possible.charAt(Math.floor(Math.random() * possible.length));
		}
		id = "tmb_" + id;
		store.set(TMB_UID_KEY, id);   
		return id;
	},
	getOrCreateGuest: function(){
github prebid / Prebid.js / modules / consoleAnalyticsAdapter.js View on Github external
enableAnalytics(config = {}) {
    baseAdapter.enableAnalytics.call(this, config);
    counter = store.get('prebid-counter');
    if (typeof counter === 'undefined') {
      counter = 1;
      store.set('prebid-counter', counter);
    } else {
      counter = Number(counter) + 1;
      store.set('prebid-counter', counter);
    }
  },
  disableAnalytics() {

store

A localStorage wrapper for all browsers without using cookies or flash. Uses localStorage, globalStorage, and userData behavior under the hood

MIT
Latest version published 7 years ago

Package Health Score

56 / 100
Full package analysis

Popular store functions