@onehat/data 1.14.0 → 1.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -61,7 +61,7 @@ class AsyncStorageRepository extends OfflineRepository {
|
|
|
61
61
|
if (this.debugMode) {
|
|
62
62
|
console.log(this.name, 'AsyncStorage.multiGet', keys);
|
|
63
63
|
}
|
|
64
|
-
|
|
64
|
+
|
|
65
65
|
const results = await AsyncStorage.multiGet(this._namespace(keys));
|
|
66
66
|
|
|
67
67
|
if (this.debugMode) {
|
|
@@ -71,7 +71,8 @@ class AsyncStorageRepository extends OfflineRepository {
|
|
|
71
71
|
const values = [];
|
|
72
72
|
if (!_.isNil(results)) {
|
|
73
73
|
const chunks = _.chunk(results, 400); // create chunks of 400, which we'll iterate through, so we don't get "Excessive number of pending callbacks" error
|
|
74
|
-
let i, n, thisChunk,
|
|
74
|
+
let i, n, thisChunk, promise, parsed,
|
|
75
|
+
promises = [];
|
|
75
76
|
for (i = 0; i < chunks.length; i++) { // iterate the chunks
|
|
76
77
|
thisChunk = chunks[i];
|
|
77
78
|
for (n = 0; n < thisChunk.length; n++) { // iterate the storage items
|
|
@@ -95,7 +96,9 @@ class AsyncStorageRepository extends OfflineRepository {
|
|
|
95
96
|
}
|
|
96
97
|
}
|
|
97
98
|
|
|
98
|
-
|
|
99
|
+
if (promises.length) {
|
|
100
|
+
await Promise.all(promises);
|
|
101
|
+
}
|
|
99
102
|
}
|
|
100
103
|
}
|
|
101
104
|
|
|
@@ -204,7 +207,7 @@ class AsyncStorageRepository extends OfflineRepository {
|
|
|
204
207
|
}
|
|
205
208
|
|
|
206
209
|
clearAll = async () => {
|
|
207
|
-
await this.load([]);
|
|
210
|
+
return await this.load([]);
|
|
208
211
|
}
|
|
209
212
|
|
|
210
213
|
getAllKeys = async () => {
|