Skip to content

Instantly share code, notes, and snippets.

@jfreyre
Created November 6, 2014 14:59
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 jfreyre/03e26ca6b9388af6096c to your computer and use it in GitHub Desktop.
Save jfreyre/03e26ca6b9388af6096c to your computer and use it in GitHub Desktop.
Storage.prototype.setObject = function(key, value) {
this.setItem(key, JSON.stringify(value));
}
Storage.prototype.getObject = function(key) {
var value = this.getItem(key);
return value && JSON.parse(value);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment