Skip to content

Instantly share code, notes, and snippets.

@alepez
Created February 28, 2015 10:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alepez/e10ecc991a2e867e55f7 to your computer and use it in GitHub Desktop.
Save alepez/e10ecc991a2e867e55f7 to your computer and use it in GitHub Desktop.
local storage value handler
var permanentValue = function (name) {
var that = {};
var prefix = 'debug-';
that.store = function (val) {
localStorage.setItem(prefix + name, val);
return val;
};
that.load = function () {
return localStorage.getItem(prefix + name);
};
return that;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment