Fix example

pull/1860/head
Tony 8 months ago
parent bfe2b38f8e
commit 50ab4c18e0
No known key found for this signature in database
GPG Key ID: 34BDD3EA27824956

@ -7,9 +7,14 @@
let key; let key;
let value; let value;
let store = new LazyStore("cache.json", { serializeFnName: "pretty-json" }); let store;
let cache = {}; let cache = {};
function newStore() {
store = new LazyStore("cache.json", { serializeFnName: "pretty-json" });
}
newStore()
async function refreshEntries() { async function refreshEntries() {
try { try {
const values = await store.entries(); const values = await store.entries();
@ -55,7 +60,7 @@
} }
function reopen() { function reopen() {
store = new LazyStore("cache.json"); newStore()
onMessage("We made a new `LazyStore` instance, operations will now work"); onMessage("We made a new `LazyStore` instance, operations will now work");
} }
</script> </script>

Loading…
Cancel
Save