improve code structure in localscoremanager
This commit is contained in:
@@ -1,14 +1,21 @@
|
|||||||
window.fakeStorage = {
|
window.fakeStorage = {
|
||||||
_data : {},
|
_data: {},
|
||||||
setItem : function (id, val) {
|
|
||||||
console.log("set");
|
setItem: function (id, val) {
|
||||||
return this._data[id] = String(val);
|
return this._data[id] = String(val);
|
||||||
},
|
},
|
||||||
getItem : function (id) {
|
|
||||||
|
getItem: function (id) {
|
||||||
return this._data.hasOwnProperty(id) ? this._data[id] : undefined;
|
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() {
|
function LocalScoreManager() {
|
||||||
|
|||||||
Reference in New Issue
Block a user