add Storage

This commit is contained in:
Gil Barbara
2015-07-23 23:44:38 -03:00
parent 44662d593f
commit b8e14f4893
6 changed files with 53 additions and 41 deletions
+19
View File
@@ -0,0 +1,19 @@
var Storage = {
getItem: function (name) {
return JSON.parse(localStorage.getItem(name));
},
setItem: function (name, value) {
localStorage.setItem(name, JSON.stringify(value));
},
removeItem: function (name) {
localStorage.removeItem(name);
},
clearAll: function () {
localStorage.clear();
}
};
module.exports = Storage;