Skip to content

Instantly share code, notes, and snippets.

@julianwinkel
Last active September 29, 2017 20:42
Show Gist options
  • Save julianwinkel/4c90840ad1663dc82fea89a0e9effe53 to your computer and use it in GitHub Desktop.
Save julianwinkel/4c90840ad1663dc82fea89a0e9effe53 to your computer and use it in GitHub Desktop.
super simple localStorage wapper. Store variables with types
// https://stackoverflow.com/a/13442834
var myLocalStorage = {
set: function (item, value) {
localStorage.setItem( item, JSON.stringify(value) );
},
get: function (item) {
return JSON.parse( localStorage.getItem(item) );
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment