Warn if writing to storage too early
// FREEBIE
This commit is contained in:
parent
f05b40e89a
commit
a98de39173
1 changed files with 3 additions and 0 deletions
|
@ -25,6 +25,9 @@
|
|||
if (value === undefined) {
|
||||
throw new Error("Tried to store undefined");
|
||||
}
|
||||
if (!ready) {
|
||||
console.log('Called storage.put before storage is ready');
|
||||
}
|
||||
var item = items.add({id: key, value: value}, {merge: true});
|
||||
item.save();
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue