improve code structure in localscoremanager

This commit is contained in:
Gabriele Cirulli
2014-03-12 13:35:42 +01:00
parent 88278792be
commit 608ca2844b
+10 -3
View File
@@ -1,14 +1,21 @@
window.fakeStorage = {
_data: {},
setItem: function (id, val) {
console.log("set");
return this._data[id] = String(val);
},
getItem: function (id) {
return this._data.hasOwnProperty(id) ? this._data[id] : undefined;
},
removeItem : function (id) { return delete this._data[id]; },
clear : function () { return this._data = {}; }
removeItem: function (id) {
return delete this._data[id];
},
clear: function () {
return this._data = {};
}
};
function LocalScoreManager() {