diff --git a/README.md b/README.md index d489c80..084d633 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,7 @@ To get started with SpeedStore all you need to do is add the library to your App { "userSymbol": "SpeedStore", "libraryId": "1t1E-r2T5Na3MwsE3DxRqV_2A9U5YWLXEPowWqc-dAUcoNJD0YaRgVs3D", - "version": "4" + "version": "6", } ] }, diff --git a/src/SpeedStore.ts b/src/SpeedStore.ts index ded033a..91b5156 100644 --- a/src/SpeedStore.ts +++ b/src/SpeedStore.ts @@ -31,7 +31,7 @@ class SpeedStore_ { get(key: string) { // Get's the value for a given key - Need to check if the key exists - if (!this.memcache) { // Trialing to always fetch from store + if (!this.memcache) { this.retrieveAll(); } if (key in this.memcache) { @@ -93,6 +93,10 @@ class SpeedStore_ { } setMany(properties: { [key: string]: any }) { + if (!this.memcache) { + this.retrieveAll() + } + for (const key in properties) { this.memcache[key] = properties[key]; }