diff --git a/examples/api/src/views/Store.svelte b/examples/api/src/views/Store.svelte index 3d8c55b2..82614038 100644 --- a/examples/api/src/views/Store.svelte +++ b/examples/api/src/views/Store.svelte @@ -7,9 +7,14 @@ let key; let value; - let store = new LazyStore("cache.json", { serializeFnName: "pretty-json" }); + let store; let cache = {}; + function newStore() { + store = new LazyStore("cache.json", { serializeFnName: "pretty-json" }); + } + newStore() + async function refreshEntries() { try { const values = await store.entries(); @@ -55,7 +60,7 @@ } function reopen() { - store = new LazyStore("cache.json"); + newStore() onMessage("We made a new `LazyStore` instance, operations will now work"); }