Skip to content

Instantly share code, notes, and snippets.

@aesnyder
Created July 23, 2014 15:51
Show Gist options
  • Save aesnyder/dbeb1d66c3fc6af6741b to your computer and use it in GitHub Desktop.
Save aesnyder/dbeb1d66c3fc6af6741b to your computer and use it in GitHub Desktop.
localstorage with non-strings
store = {
get: function(path) { return JSON.parse(localStorage.getItem(path)); },
set: function(path, item) {
localStorage.setItem(path, JSON.stringify(item));
return item;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment