react-native-onyx 1.0.61 → 1.0.63
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/dist/web.development.js +63 -202
- package/dist/web.development.js.map +1 -1
- package/dist/web.min.js +1 -1
- package/dist/web.min.js.map +1 -1
- package/lib/storage/WebStorage.js +2 -2
- package/lib/storage/__mocks__/index.js +15 -15
- package/lib/storage/providers/IDBKeyVal.js +118 -0
- package/package.json +6 -10
- package/lib/storage/providers/LocalForage.js +0 -158
package/dist/web.development.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
2
2
|
if(typeof exports === 'object' && typeof module === 'object')
|
|
3
|
-
module.exports = factory(require("fast-equals"), require("underscore"), require("
|
|
3
|
+
module.exports = factory(require("fast-equals"), require("underscore"), require("idb-keyval"), require("lodash/transform"), require("react"));
|
|
4
4
|
else if(typeof define === 'function' && define.amd)
|
|
5
|
-
define(["fast-equals", "underscore", "
|
|
5
|
+
define(["fast-equals", "underscore", "idb-keyval", "lodash/transform", "react"], factory);
|
|
6
6
|
else if(typeof exports === 'object')
|
|
7
|
-
exports["react-native-onyx/web"] = factory(require("fast-equals"), require("underscore"), require("
|
|
7
|
+
exports["react-native-onyx/web"] = factory(require("fast-equals"), require("underscore"), require("idb-keyval"), require("lodash/transform"), require("react"));
|
|
8
8
|
else
|
|
9
|
-
root["react-native-onyx/web"] = factory(root["fast-equals"], root["underscore"], root["
|
|
10
|
-
})(self, (__WEBPACK_EXTERNAL_MODULE_fast_equals__, __WEBPACK_EXTERNAL_MODULE_underscore__,
|
|
9
|
+
root["react-native-onyx/web"] = factory(root["fast-equals"], root["underscore"], root["idb-keyval"], root["lodash/transform"], root["react"]);
|
|
10
|
+
})(self, (__WEBPACK_EXTERNAL_MODULE_fast_equals__, __WEBPACK_EXTERNAL_MODULE_underscore__, __WEBPACK_EXTERNAL_MODULE_idb_keyval__, __WEBPACK_EXTERNAL_MODULE_lodash_transform__, __WEBPACK_EXTERNAL_MODULE_react__) => {
|
|
11
11
|
return /******/ (() => { // webpackBootstrap
|
|
12
12
|
/******/ var __webpack_modules__ = ({
|
|
13
13
|
|
|
@@ -1812,79 +1812,6 @@ function result(parameter) {for (var _len = arguments.length, args = new Array(_
|
|
|
1812
1812
|
|
|
1813
1813
|
|
|
1814
1814
|
|
|
1815
|
-
/***/ }),
|
|
1816
|
-
|
|
1817
|
-
/***/ "./lib/SyncQueue.js":
|
|
1818
|
-
/*!**************************!*\
|
|
1819
|
-
!*** ./lib/SyncQueue.js ***!
|
|
1820
|
-
\**************************/
|
|
1821
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1822
|
-
|
|
1823
|
-
"use strict";
|
|
1824
|
-
__webpack_require__.r(__webpack_exports__);
|
|
1825
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1826
|
-
/* harmony export */ "default": () => (/* binding */ SyncQueue)
|
|
1827
|
-
/* harmony export */ });
|
|
1828
|
-
/**
|
|
1829
|
-
* Synchronous queue that can be used to ensure promise based tasks are run in sequence.
|
|
1830
|
-
* Pass to the constructor a function that returns a promise to run the task then add data.
|
|
1831
|
-
*
|
|
1832
|
-
* @example
|
|
1833
|
-
*
|
|
1834
|
-
* const queue = new SyncQueue(({key, val}) => {
|
|
1835
|
-
* return someAsyncProcess(key, val);
|
|
1836
|
-
* });
|
|
1837
|
-
*
|
|
1838
|
-
* queue.push({key: 1, val: '1'});
|
|
1839
|
-
* queue.push({key: 2, val: '2'});
|
|
1840
|
-
*/
|
|
1841
|
-
class SyncQueue {
|
|
1842
|
-
/**
|
|
1843
|
-
* @param {Function} run - must return a promise
|
|
1844
|
-
*/
|
|
1845
|
-
constructor(run) {
|
|
1846
|
-
this.queue = [];
|
|
1847
|
-
this.isProcessing = false;
|
|
1848
|
-
this.run = run;
|
|
1849
|
-
}
|
|
1850
|
-
|
|
1851
|
-
/**
|
|
1852
|
-
* Stop the queue from being processed and clear out any existing tasks
|
|
1853
|
-
*/
|
|
1854
|
-
abort() {
|
|
1855
|
-
this.queue = [];
|
|
1856
|
-
this.isProcessing = false;
|
|
1857
|
-
}
|
|
1858
|
-
|
|
1859
|
-
process() {
|
|
1860
|
-
if (this.isProcessing || this.queue.length === 0) {
|
|
1861
|
-
return;
|
|
1862
|
-
}
|
|
1863
|
-
|
|
1864
|
-
this.isProcessing = true;
|
|
1865
|
-
|
|
1866
|
-
const { data, resolve, reject } = this.queue.shift();
|
|
1867
|
-
this.run(data).
|
|
1868
|
-
then(resolve).
|
|
1869
|
-
catch(reject).
|
|
1870
|
-
finally(() => {
|
|
1871
|
-
this.isProcessing = false;
|
|
1872
|
-
this.process();
|
|
1873
|
-
});
|
|
1874
|
-
}
|
|
1875
|
-
|
|
1876
|
-
/**
|
|
1877
|
-
* @param {*} data
|
|
1878
|
-
* @returns {Promise}
|
|
1879
|
-
*/
|
|
1880
|
-
push(data) {
|
|
1881
|
-
return new Promise((resolve, reject) => {
|
|
1882
|
-
this.queue.push({ resolve, reject, data });
|
|
1883
|
-
this.process();
|
|
1884
|
-
});
|
|
1885
|
-
}
|
|
1886
|
-
}
|
|
1887
|
-
|
|
1888
1815
|
/***/ }),
|
|
1889
1816
|
|
|
1890
1817
|
/***/ "./lib/createDeferredTask.js":
|
|
@@ -2119,9 +2046,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
2119
2046
|
/* harmony export */ });
|
|
2120
2047
|
/* harmony import */ var underscore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! underscore */ "underscore");
|
|
2121
2048
|
/* harmony import */ var underscore__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(underscore__WEBPACK_IMPORTED_MODULE_0__);
|
|
2122
|
-
/* harmony import */ var
|
|
2049
|
+
/* harmony import */ var _providers_IDBKeyVal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./providers/IDBKeyVal */ "./lib/storage/providers/IDBKeyVal.js");
|
|
2123
2050
|
/**
|
|
2124
|
-
* This file is here to wrap
|
|
2051
|
+
* This file is here to wrap IDBKeyVal with a layer that provides data-changed events like the ones that exist
|
|
2125
2052
|
* when using LocalStorage APIs in the browser. These events are great because multiple tabs can listen for when
|
|
2126
2053
|
* data changes and then stay up-to-date with everything happening in Onyx.
|
|
2127
2054
|
*/
|
|
@@ -2146,20 +2073,20 @@ function raiseStorageSyncManyKeysEvent(onyxKeys) {
|
|
|
2146
2073
|
}
|
|
2147
2074
|
|
|
2148
2075
|
const webStorage = {
|
|
2149
|
-
...
|
|
2076
|
+
..._providers_IDBKeyVal__WEBPACK_IMPORTED_MODULE_1__["default"],
|
|
2150
2077
|
|
|
2151
2078
|
/**
|
|
2152
2079
|
* @param {Function} onStorageKeyChanged Storage synchronization mechanism keeping all opened tabs in sync
|
|
2153
2080
|
*/
|
|
2154
2081
|
keepInstancesSync(onStorageKeyChanged) {
|
|
2155
2082
|
// Override set, remove and clear to raise storage events that we intercept in other tabs
|
|
2156
|
-
this.setItem = (key, value) =>
|
|
2083
|
+
this.setItem = (key, value) => _providers_IDBKeyVal__WEBPACK_IMPORTED_MODULE_1__["default"].setItem(key, value).
|
|
2157
2084
|
then(() => raiseStorageSyncEvent(key));
|
|
2158
2085
|
|
|
2159
|
-
this.removeItem = (key) =>
|
|
2086
|
+
this.removeItem = (key) => _providers_IDBKeyVal__WEBPACK_IMPORTED_MODULE_1__["default"].removeItem(key).
|
|
2160
2087
|
then(() => raiseStorageSyncEvent(key));
|
|
2161
2088
|
|
|
2162
|
-
this.removeItems = (keys) =>
|
|
2089
|
+
this.removeItems = (keys) => _providers_IDBKeyVal__WEBPACK_IMPORTED_MODULE_1__["default"].removeItems(keys).
|
|
2163
2090
|
then(() => raiseStorageSyncManyKeysEvent(keys));
|
|
2164
2091
|
|
|
2165
2092
|
// If we just call Storage.clear other tabs will have no idea which keys were available previously
|
|
@@ -2169,11 +2096,11 @@ const webStorage = {
|
|
|
2169
2096
|
let allKeys;
|
|
2170
2097
|
|
|
2171
2098
|
// They keys must be retreived before storage is cleared or else the list of keys would be empty
|
|
2172
|
-
return
|
|
2099
|
+
return _providers_IDBKeyVal__WEBPACK_IMPORTED_MODULE_1__["default"].getAllKeys().
|
|
2173
2100
|
then((keys) => {
|
|
2174
2101
|
allKeys = keys;
|
|
2175
2102
|
}).
|
|
2176
|
-
then(() =>
|
|
2103
|
+
then(() => _providers_IDBKeyVal__WEBPACK_IMPORTED_MODULE_1__["default"].clear()).
|
|
2177
2104
|
then(() => {
|
|
2178
2105
|
// Now that storage is cleared, the storage sync event can happen which is a more atomic action
|
|
2179
2106
|
// for other browser tabs
|
|
@@ -2189,7 +2116,7 @@ const webStorage = {
|
|
|
2189
2116
|
}
|
|
2190
2117
|
|
|
2191
2118
|
const onyxKey = event.newValue;
|
|
2192
|
-
|
|
2119
|
+
_providers_IDBKeyVal__WEBPACK_IMPORTED_MODULE_1__["default"].getItem(onyxKey).
|
|
2193
2120
|
then((value) => onStorageKeyChanged(onyxKey, value));
|
|
2194
2121
|
});
|
|
2195
2122
|
}
|
|
@@ -2217,10 +2144,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
2217
2144
|
|
|
2218
2145
|
/***/ }),
|
|
2219
2146
|
|
|
2220
|
-
/***/ "./lib/storage/providers/
|
|
2221
|
-
|
|
2222
|
-
!*** ./lib/storage/providers/
|
|
2223
|
-
|
|
2147
|
+
/***/ "./lib/storage/providers/IDBKeyVal.js":
|
|
2148
|
+
/*!********************************************!*\
|
|
2149
|
+
!*** ./lib/storage/providers/IDBKeyVal.js ***!
|
|
2150
|
+
\********************************************/
|
|
2224
2151
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
2225
2152
|
|
|
2226
2153
|
"use strict";
|
|
@@ -2228,102 +2155,63 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
2228
2155
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2229
2156
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
2230
2157
|
/* harmony export */ });
|
|
2231
|
-
/* harmony import */ var
|
|
2232
|
-
/* harmony import */ var
|
|
2158
|
+
/* harmony import */ var idb_keyval__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! idb-keyval */ "idb-keyval");
|
|
2159
|
+
/* harmony import */ var idb_keyval__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(idb_keyval__WEBPACK_IMPORTED_MODULE_0__);
|
|
2233
2160
|
/* harmony import */ var underscore__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! underscore */ "underscore");
|
|
2234
2161
|
/* harmony import */ var underscore__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(underscore__WEBPACK_IMPORTED_MODULE_1__);
|
|
2235
|
-
/* harmony import */ var
|
|
2236
|
-
/* harmony import */ var localforage_removeitems__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(localforage_removeitems__WEBPACK_IMPORTED_MODULE_2__);
|
|
2237
|
-
/* harmony import */ var _SyncQueue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../SyncQueue */ "./lib/SyncQueue.js");
|
|
2238
|
-
/* harmony import */ var _Str__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../Str */ "./lib/Str.js");
|
|
2239
|
-
/* harmony import */ var _fastMerge__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../fastMerge */ "./lib/fastMerge.js");
|
|
2240
|
-
/**
|
|
2241
|
-
* @file
|
|
2242
|
-
* The storage provider based on localforage allows us to store most anything in its
|
|
2243
|
-
* natural form in the underlying DB without having to stringify or de-stringify it
|
|
2244
|
-
*/
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2162
|
+
/* harmony import */ var _fastMerge__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../fastMerge */ "./lib/fastMerge.js");
|
|
2250
2163
|
|
|
2251
2164
|
|
|
2252
2165
|
|
|
2253
|
-
(0,localforage_removeitems__WEBPACK_IMPORTED_MODULE_2__.extendPrototype)((localforage__WEBPACK_IMPORTED_MODULE_0___default()));
|
|
2254
2166
|
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2167
|
+
// We don't want to initialize the store while the JS bundle loads as idb-keyval will try to use global.indexedDB
|
|
2168
|
+
// which might not be available in certain environments that load the bundle (e.g. electron main process).
|
|
2169
|
+
let customStoreInstance;
|
|
2170
|
+
const getCustomStore = () => {
|
|
2171
|
+
if (!customStoreInstance) {
|
|
2172
|
+
customStoreInstance = (0,idb_keyval__WEBPACK_IMPORTED_MODULE_0__.createStore)('OnyxDB', 'keyvaluepairs');
|
|
2173
|
+
}
|
|
2174
|
+
return customStoreInstance;
|
|
2175
|
+
};
|
|
2263
2176
|
|
|
2264
2177
|
const provider = {
|
|
2265
|
-
/**
|
|
2266
|
-
* Writing very quickly to IndexedDB causes performance issues and can lock up the page and lead to jank.
|
|
2267
|
-
* So, we are slowing this process down by waiting until one write is complete before moving on
|
|
2268
|
-
* to the next.
|
|
2269
|
-
*/
|
|
2270
|
-
setItemQueue: new _SyncQueue__WEBPACK_IMPORTED_MODULE_3__["default"]((_ref) => {let { key, value, shouldMerge } = _ref;
|
|
2271
|
-
if (underscore__WEBPACK_IMPORTED_MODULE_1___default().find(memoryOnlyKeys, (noCacheKey) => _Str__WEBPACK_IMPORTED_MODULE_4__.startsWith(key, noCacheKey))) {
|
|
2272
|
-
return Promise.resolve();
|
|
2273
|
-
}
|
|
2274
|
-
|
|
2275
|
-
if (shouldMerge) {
|
|
2276
|
-
return localforage__WEBPACK_IMPORTED_MODULE_0___default().getItem(key).
|
|
2277
|
-
then((existingValue) => {
|
|
2278
|
-
const newValue = underscore__WEBPACK_IMPORTED_MODULE_1___default().isObject(existingValue)
|
|
2279
|
-
|
|
2280
|
-
// lodash adds a small overhead so we don't use it here
|
|
2281
|
-
// eslint-disable-next-line prefer-object-spread, rulesdir/prefer-underscore-method
|
|
2282
|
-
? Object.assign({}, (0,_fastMerge__WEBPACK_IMPORTED_MODULE_5__["default"])(existingValue, value)) :
|
|
2283
|
-
value;
|
|
2284
|
-
return localforage__WEBPACK_IMPORTED_MODULE_0___default().setItem(key, newValue);
|
|
2285
|
-
});
|
|
2286
|
-
}
|
|
2287
|
-
|
|
2288
|
-
return localforage__WEBPACK_IMPORTED_MODULE_0___default().setItem(key, value);
|
|
2289
|
-
}),
|
|
2290
|
-
|
|
2291
2178
|
/**
|
|
2292
2179
|
* Sets the value for a given key. The only requirement is that the value should be serializable to JSON string
|
|
2293
2180
|
* @param {String} key
|
|
2294
2181
|
* @param {*} value
|
|
2295
2182
|
* @return {Promise<void>}
|
|
2296
2183
|
*/
|
|
2297
|
-
setItem(key, value)
|
|
2298
|
-
return this.setItemQueue.push({ key, value });
|
|
2299
|
-
},
|
|
2184
|
+
setItem: (key, value) => (0,idb_keyval__WEBPACK_IMPORTED_MODULE_0__.set)(key, value, getCustomStore()),
|
|
2300
2185
|
|
|
2301
2186
|
/**
|
|
2302
|
-
* Get multiple key-value pairs for the give array of keys in a batch
|
|
2303
|
-
*
|
|
2187
|
+
* Get multiple key-value pairs for the give array of keys in a batch.
|
|
2188
|
+
* This is optimized to use only one database transaction.
|
|
2189
|
+
* @param {String[]} keysParam
|
|
2304
2190
|
* @return {Promise<Array<[key, value]>>}
|
|
2305
2191
|
*/
|
|
2306
|
-
multiGet(
|
|
2307
|
-
|
|
2308
|
-
keys,
|
|
2309
|
-
(key) => localforage__WEBPACK_IMPORTED_MODULE_0___default().getItem(key).
|
|
2310
|
-
then((value) => [key, value]));
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
return Promise.all(pairs);
|
|
2314
|
-
},
|
|
2192
|
+
multiGet: (keysParam) => (0,idb_keyval__WEBPACK_IMPORTED_MODULE_0__.getMany)(keysParam, getCustomStore()).
|
|
2193
|
+
then((values) => underscore__WEBPACK_IMPORTED_MODULE_1___default().map(values, (value, index) => [keysParam[index], value])),
|
|
2315
2194
|
|
|
2316
2195
|
/**
|
|
2317
2196
|
* Multiple merging of existing and new values in a batch
|
|
2318
2197
|
* @param {Array<[key, value]>} pairs
|
|
2319
2198
|
* @return {Promise<void>}
|
|
2320
2199
|
*/
|
|
2321
|
-
multiMerge(pairs) {
|
|
2322
|
-
|
|
2200
|
+
multiMerge: (pairs) => getCustomStore()('readwrite', (store) => {
|
|
2201
|
+
// Note: we are using the manual store transaction here, to fit the read and update
|
|
2202
|
+
// of the items in one transaction to achieve best performance.
|
|
2323
2203
|
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2204
|
+
const getValues = Promise.all(underscore__WEBPACK_IMPORTED_MODULE_1___default().map(pairs, (_ref) => {let [key] = _ref;return (0,idb_keyval__WEBPACK_IMPORTED_MODULE_0__.promisifyRequest)(store.get(key));}));
|
|
2205
|
+
|
|
2206
|
+
return getValues.then((values) => {
|
|
2207
|
+
const upsertMany = underscore__WEBPACK_IMPORTED_MODULE_1___default().map(pairs, (_ref2, index) => {let [key, value] = _ref2;
|
|
2208
|
+
const prev = values[index];
|
|
2209
|
+
const newValue = underscore__WEBPACK_IMPORTED_MODULE_1___default().isObject(prev) ? (0,_fastMerge__WEBPACK_IMPORTED_MODULE_2__["default"])(prev, value) : value;
|
|
2210
|
+
return (0,idb_keyval__WEBPACK_IMPORTED_MODULE_0__.promisifyRequest)(store.put(newValue, key));
|
|
2211
|
+
});
|
|
2212
|
+
return Promise.all(upsertMany);
|
|
2213
|
+
});
|
|
2214
|
+
}),
|
|
2327
2215
|
|
|
2328
2216
|
/**
|
|
2329
2217
|
* Merging an existing value with a new one
|
|
@@ -2333,7 +2221,7 @@ const provider = {
|
|
|
2333
2221
|
* @return {Promise<void>}
|
|
2334
2222
|
*/
|
|
2335
2223
|
mergeItem(key, _changes, modifiedData) {
|
|
2336
|
-
return
|
|
2224
|
+
return provider.multiMerge([[key, modifiedData]]);
|
|
2337
2225
|
},
|
|
2338
2226
|
|
|
2339
2227
|
/**
|
|
@@ -2341,57 +2229,41 @@ const provider = {
|
|
|
2341
2229
|
* @param {Array<[key, value]>} pairs
|
|
2342
2230
|
* @return {Promise<void>}
|
|
2343
2231
|
*/
|
|
2344
|
-
multiSet(pairs)
|
|
2345
|
-
// We're returning Promise.resolve, otherwise the array of task results will be returned to the caller
|
|
2346
|
-
const tasks = underscore__WEBPACK_IMPORTED_MODULE_1___default().map(pairs, (_ref3) => {let [key, value] = _ref3;return this.setItem(key, value);});
|
|
2347
|
-
return Promise.all(tasks).then(() => Promise.resolve());
|
|
2348
|
-
},
|
|
2232
|
+
multiSet: (pairs) => (0,idb_keyval__WEBPACK_IMPORTED_MODULE_0__.setMany)(pairs, getCustomStore()),
|
|
2349
2233
|
|
|
2350
2234
|
/**
|
|
2351
2235
|
* Clear everything from storage and also stops the SyncQueue from adding anything more to storage
|
|
2352
2236
|
* @returns {Promise<void>}
|
|
2353
2237
|
*/
|
|
2354
|
-
clear()
|
|
2355
|
-
this.setItemQueue.abort();
|
|
2356
|
-
return localforage__WEBPACK_IMPORTED_MODULE_0___default().clear();
|
|
2357
|
-
},
|
|
2238
|
+
clear: () => (0,idb_keyval__WEBPACK_IMPORTED_MODULE_0__.clear)(getCustomStore()),
|
|
2358
2239
|
|
|
2359
2240
|
/**
|
|
2360
2241
|
* Returns all keys available in storage
|
|
2361
2242
|
* @returns {Promise<String[]>}
|
|
2362
2243
|
*/
|
|
2363
|
-
getAllKeys: (
|
|
2244
|
+
getAllKeys: () => (0,idb_keyval__WEBPACK_IMPORTED_MODULE_0__.keys)(getCustomStore()),
|
|
2364
2245
|
|
|
2365
2246
|
/**
|
|
2366
2247
|
* Get the value of a given key or return `null` if it's not available in storage
|
|
2367
2248
|
* @param {String} key
|
|
2368
2249
|
* @return {Promise<*>}
|
|
2369
2250
|
*/
|
|
2370
|
-
getItem: (
|
|
2251
|
+
getItem: (key) => (0,idb_keyval__WEBPACK_IMPORTED_MODULE_0__.get)(key, getCustomStore()),
|
|
2371
2252
|
|
|
2372
2253
|
/**
|
|
2373
2254
|
* Remove given key and it's value from storage
|
|
2374
2255
|
* @param {String} key
|
|
2375
2256
|
* @returns {Promise<void>}
|
|
2376
2257
|
*/
|
|
2377
|
-
removeItem: (
|
|
2258
|
+
removeItem: (key) => (0,idb_keyval__WEBPACK_IMPORTED_MODULE_0__.del)(key, getCustomStore()),
|
|
2378
2259
|
|
|
2379
2260
|
/**
|
|
2380
2261
|
* Remove given keys and their values from storage
|
|
2381
2262
|
*
|
|
2382
|
-
* @param {Array}
|
|
2263
|
+
* @param {Array} keysParam
|
|
2383
2264
|
* @returns {Promise}
|
|
2384
2265
|
*/
|
|
2385
|
-
removeItems(
|
|
2386
|
-
return localforage__WEBPACK_IMPORTED_MODULE_0___default().removeItems(keys);
|
|
2387
|
-
},
|
|
2388
|
-
|
|
2389
|
-
/**
|
|
2390
|
-
* @param {string[]} keyList
|
|
2391
|
-
*/
|
|
2392
|
-
setMemoryOnlyKeys(keyList) {
|
|
2393
|
-
memoryOnlyKeys = keyList;
|
|
2394
|
-
}
|
|
2266
|
+
removeItems: (keysParam) => (0,idb_keyval__WEBPACK_IMPORTED_MODULE_0__.delMany)(keysParam, getCustomStore())
|
|
2395
2267
|
};
|
|
2396
2268
|
|
|
2397
2269
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (provider);
|
|
@@ -3744,25 +3616,14 @@ module.exports = __WEBPACK_EXTERNAL_MODULE_fast_equals__;
|
|
|
3744
3616
|
|
|
3745
3617
|
/***/ }),
|
|
3746
3618
|
|
|
3747
|
-
/***/ "
|
|
3748
|
-
|
|
3749
|
-
!*** external "
|
|
3750
|
-
|
|
3751
|
-
/***/ ((module) => {
|
|
3752
|
-
|
|
3753
|
-
"use strict";
|
|
3754
|
-
module.exports = __WEBPACK_EXTERNAL_MODULE_localforage__;
|
|
3755
|
-
|
|
3756
|
-
/***/ }),
|
|
3757
|
-
|
|
3758
|
-
/***/ "localforage-removeitems":
|
|
3759
|
-
/*!******************************************!*\
|
|
3760
|
-
!*** external "localforage-removeitems" ***!
|
|
3761
|
-
\******************************************/
|
|
3619
|
+
/***/ "idb-keyval":
|
|
3620
|
+
/*!*****************************!*\
|
|
3621
|
+
!*** external "idb-keyval" ***!
|
|
3622
|
+
\*****************************/
|
|
3762
3623
|
/***/ ((module) => {
|
|
3763
3624
|
|
|
3764
3625
|
"use strict";
|
|
3765
|
-
module.exports =
|
|
3626
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE_idb_keyval__;
|
|
3766
3627
|
|
|
3767
3628
|
/***/ }),
|
|
3768
3629
|
|