DocumentsStore WIP

This commit is contained in:
Tom Moor
2017-06-27 20:59:53 -07:00
parent f8a715dcef
commit 72fd39b494
8 changed files with 125 additions and 9 deletions

20
__mocks__/localStorage.js Normal file
View File

@ -0,0 +1,20 @@
const storage = {};
export default {
setItem: function(key, value) {
storage[key] = value || '';
},
getItem: function(key) {
return key in storage ? storage[key] : null;
},
removeItem: function(key) {
delete storage[key];
},
get length() {
return Object.keys(storage).length;
},
key: function(i) {
var keys = Object.keys(storage);
return keys[i] || null;
},
};