How to use store - 10 common examples

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 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 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 mediathekview / mediathekviewweb / client / src / app / settings.ts View on Github external
private static get(namespace: string, key: string): T {
    console.log('get', key)
    if (Settings.cache[namespace].hasOwnProperty(key) == false) {
      let storedValue = StoreJS.get(namespace + '_' + key);
      if (storedValue == undefined) {
        storedValue = DEFAULTS[key];
      }
      Settings.cache[namespace][key] = storedValue;
    }

    return Settings.cache[namespace][key];
  }
github osmlab / to-fix / lib / core.js View on Github external
function request(error, callback) {
    $.ajax({
        crossDomain: true,
        url: url + 'error/' + error,
        type: 'post',
        data: JSON.stringify({user: store.get('username')})
    })
    .error(jqError)
    .done(callback);
}
github wbkd / dashboard-prototyper / app / scripts / widgets / todos / todosStore.js View on Github external
get: function(){
    
    this.todos = store.get('todos') || [];
    
    this.trigger({ 
      data: this.todos
    });
  },
github osmlab / to-fix / src / stores / application_store.js View on Github external
toggle: function() {
    if (store.get('sidebar')) {
      store.remove('sidebar');
      this.settings.sidebar = false;
    } else {
      store.set('sidebar', true);
      this.settings.sidebar = store.get('sidebar');
    }

    this.trigger(this.settings);
  }
});
github Automattic / wp-calypso / client / lib / site-stats-sticky-tab / store.js View on Github external
function getCachedPlace() {
	var cached = store.get( constants.CACHE_KEY_MY_PLACE );
	if ( cached ) {
		return cached;
	}
	return {};
}
github paulstatezny / decisive / application / flux / grid-store.js View on Github external
initialize : function()
    {
        this.grids = store.get('grids');

        if (! this.grids) {
            this.grids = [this.getInitialGrid()];
        }

        this.selectedGrid = 0;

        this.bindActions(
            'ADD_GRID', 'onAddGrid',
            'ADD_TASK', 'onAddTask',
            'TOGGLE_COMPLETED', 'onToggleCompleted',
            'REMOVE_TASK', 'onRemoveTask',
            'SELECT_GRID', 'onSelectGrid',
            'DELETE_GRID', 'onDeleteGrid'
        );
    },
github mulesoft / api-notebook / src / scripts / state / store.js View on Github external
_.each(storage.getAll(), function (value, key) {
      if (this._isPersistenceKey(key)) {
        storage.remove(key);
      }
    }, this);
  }

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 8 years ago

Package Health Score

58 / 100
Full package analysis

Popular store functions