Created
July 23, 2014 15:51
-
-
Save aesnyder/dbeb1d66c3fc6af6741b to your computer and use it in GitHub Desktop.
localstorage with non-strings
This file contains 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
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