Skip to content

Commit

Permalink
improve code structure in localscoremanager
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielecirulli committed Mar 12, 2014
1 parent 8827879 commit 608ca28
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions js/local_score_manager.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
window.fakeStorage = {
_data : {},
setItem : function (id, val) {
console.log("set");
_data: {},

setItem: function (id, val) {
return this._data[id] = String(val);
},
getItem : function (id) {

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() {
Expand Down

0 comments on commit 608ca28

Please sign in to comment.