architecture refactor
This commit is contained in:
parent
6d90020205
commit
59c00da592
17 changed files with 151 additions and 47 deletions
|
|
@ -1,26 +0,0 @@
|
|||
'use strict';
|
||||
|
||||
var imports = require('soop').imports();
|
||||
|
||||
function Storage() {
|
||||
this.data = {};
|
||||
}
|
||||
|
||||
Storage.prototype.get = function(k) {
|
||||
return JSON.parse(localStorage.getItem(k));
|
||||
};
|
||||
|
||||
Storage.prototype.set = function(k,v) {
|
||||
localStorage.setItem(k, JSON.stringify(v));
|
||||
};
|
||||
|
||||
Storage.prototype.remove = function(k) {
|
||||
localStorage.removeItem(k);
|
||||
};
|
||||
|
||||
|
||||
Storage.prototype.clearAll = function() {
|
||||
localStorage.clear();
|
||||
};
|
||||
|
||||
module.exports = require('soop')(Storage);
|
||||
Loading…
Add table
Add a link
Reference in a new issue