Created
February 28, 2015 10:28
-
-
Save alepez/e10ecc991a2e867e55f7 to your computer and use it in GitHub Desktop.
local storage value handler
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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