react-native-onyx 2.0.21 → 2.0.22
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/API.md +0 -14
- package/dist/Onyx.d.ts +0 -6
- package/dist/Onyx.js +0 -10
- package/dist/storage/__mocks__/index.d.ts +0 -1
- package/dist/storage/__mocks__/index.js +0 -3
- package/dist/storage/providers/IDBKeyVal.js +0 -2
- package/dist/storage/providers/SQLiteStorage.js +0 -2
- package/dist/storage/providers/types.d.ts +0 -4
- package/package.json +1 -1
package/API.md
CHANGED
|
@@ -94,9 +94,6 @@ value will be saved to storage after the default value.</p>
|
|
|
94
94
|
<dt><a href="#update">update(data)</a> ⇒ <code>Promise</code></dt>
|
|
95
95
|
<dd><p>Insert API responses and lifecycle data into Onyx</p>
|
|
96
96
|
</dd>
|
|
97
|
-
<dt><a href="#setMemoryOnlyKeys">setMemoryOnlyKeys(keyList)</a></dt>
|
|
98
|
-
<dd><p>When set these keys will not be persisted to storage</p>
|
|
99
|
-
</dd>
|
|
100
97
|
<dt><a href="#init">init([options])</a></dt>
|
|
101
98
|
<dd><p>Initialize the store with actions and listening for storage events</p>
|
|
102
99
|
</dd>
|
|
@@ -424,17 +421,6 @@ Insert API responses and lifecycle data into Onyx
|
|
|
424
421
|
| --- | --- | --- |
|
|
425
422
|
| data | <code>Array</code> | An array of objects with shape {onyxMethod: oneOf('set', 'merge', 'mergeCollection', 'multiSet', 'clear'), key: string, value: *} |
|
|
426
423
|
|
|
427
|
-
<a name="setMemoryOnlyKeys"></a>
|
|
428
|
-
|
|
429
|
-
## setMemoryOnlyKeys(keyList)
|
|
430
|
-
When set these keys will not be persisted to storage
|
|
431
|
-
|
|
432
|
-
**Kind**: global function
|
|
433
|
-
|
|
434
|
-
| Param | Type |
|
|
435
|
-
| --- | --- |
|
|
436
|
-
| keyList | <code>Array.<string></code> |
|
|
437
|
-
|
|
438
424
|
<a name="init"></a>
|
|
439
425
|
|
|
440
426
|
## init([options])
|
package/dist/Onyx.d.ts
CHANGED
|
@@ -304,11 +304,6 @@ declare function init(config?: InitOptions): void;
|
|
|
304
304
|
*/
|
|
305
305
|
declare function hasPendingMergeForKey(key: OnyxKey): boolean;
|
|
306
306
|
|
|
307
|
-
/**
|
|
308
|
-
* When set these keys will not be persisted to storage
|
|
309
|
-
*/
|
|
310
|
-
declare function setMemoryOnlyKeys(keyList: OnyxKey[]): void;
|
|
311
|
-
|
|
312
307
|
/**
|
|
313
308
|
* Tries to get a value from the cache. If the value is not present in cache it will return the default value or undefined.
|
|
314
309
|
* If the requested key is a collection, it will return an object with all the collection members.
|
|
@@ -335,7 +330,6 @@ declare const Onyx: {
|
|
|
335
330
|
removeFromEvictionBlockList: typeof removeFromEvictionBlockList;
|
|
336
331
|
isSafeEvictionKey: typeof isSafeEvictionKey;
|
|
337
332
|
METHOD: typeof METHOD;
|
|
338
|
-
setMemoryOnlyKeys: typeof setMemoryOnlyKeys;
|
|
339
333
|
tryGetCachedValue: typeof tryGetCachedValue;
|
|
340
334
|
isCollectionKey: typeof isCollectionKey;
|
|
341
335
|
isCollectionMemberKey: typeof isCollectionMemberKey;
|
package/dist/Onyx.js
CHANGED
|
@@ -1431,15 +1431,6 @@ function update(data) {
|
|
|
1431
1431
|
});
|
|
1432
1432
|
return clearPromise.then(() => Promise.all(underscore_1.default.map(promises, (p) => p())));
|
|
1433
1433
|
}
|
|
1434
|
-
/**
|
|
1435
|
-
* When set these keys will not be persisted to storage
|
|
1436
|
-
* @param {string[]} keyList
|
|
1437
|
-
*/
|
|
1438
|
-
function setMemoryOnlyKeys(keyList) {
|
|
1439
|
-
storage_1.default.setMemoryOnlyKeys(keyList);
|
|
1440
|
-
// When in memory only mode for certain keys we do not want to ever drop items from the cache as the user will have no way to recover them again via storage.
|
|
1441
|
-
OnyxCache_1.default.setRecentKeysLimit(Infinity);
|
|
1442
|
-
}
|
|
1443
1434
|
/**
|
|
1444
1435
|
* Initialize the store with actions and listening for storage events
|
|
1445
1436
|
*
|
|
@@ -1510,7 +1501,6 @@ const Onyx = {
|
|
|
1510
1501
|
removeFromEvictionBlockList,
|
|
1511
1502
|
isSafeEvictionKey,
|
|
1512
1503
|
METHOD,
|
|
1513
|
-
setMemoryOnlyKeys,
|
|
1514
1504
|
tryGetCachedValue,
|
|
1515
1505
|
hasPendingMergeForKey,
|
|
1516
1506
|
isCollectionKey,
|
|
@@ -60,8 +60,6 @@ const idbKeyvalMock = {
|
|
|
60
60
|
getDatabaseSize() {
|
|
61
61
|
return Promise.resolve({ bytesRemaining: 0, bytesUsed: 99999 });
|
|
62
62
|
},
|
|
63
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
64
|
-
setMemoryOnlyKeys() { },
|
|
65
63
|
};
|
|
66
64
|
const idbKeyvalMockSpy = {
|
|
67
65
|
idbKeyvalSet: set,
|
|
@@ -80,6 +78,5 @@ const idbKeyvalMockSpy = {
|
|
|
80
78
|
storageMapInternal = data;
|
|
81
79
|
}),
|
|
82
80
|
getDatabaseSize: jest.fn(idbKeyvalMock.getDatabaseSize),
|
|
83
|
-
setMemoryOnlyKeys: jest.fn(idbKeyvalMock.setMemoryOnlyKeys),
|
|
84
81
|
};
|
|
85
82
|
exports.default = idbKeyvalMockSpy;
|
|
@@ -37,8 +37,6 @@ const provider = {
|
|
|
37
37
|
},
|
|
38
38
|
multiSet: (pairs) => (0, idb_keyval_1.setMany)(pairs, getCustomStore()),
|
|
39
39
|
clear: () => (0, idb_keyval_1.clear)(getCustomStore()),
|
|
40
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
41
|
-
setMemoryOnlyKeys: () => { },
|
|
42
40
|
getAllKeys: () => (0, idb_keyval_1.keys)(getCustomStore()),
|
|
43
41
|
getItem: (key) => (0, idb_keyval_1.get)(key, getCustomStore())
|
|
44
42
|
// idb-keyval returns undefined for missing items, but this needs to return null so that idb-keyval does the same thing as SQLiteStorage.
|
|
@@ -85,8 +85,6 @@ const provider = {
|
|
|
85
85
|
});
|
|
86
86
|
},
|
|
87
87
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
88
|
-
setMemoryOnlyKeys: () => { },
|
|
89
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
90
88
|
keepInstancesSync: () => { },
|
|
91
89
|
};
|
|
92
90
|
exports.default = provider;
|
|
@@ -48,10 +48,6 @@ type StorageProvider = {
|
|
|
48
48
|
* Clears absolutely everything from storage
|
|
49
49
|
*/
|
|
50
50
|
clear: () => Promise<QueryResult | void>;
|
|
51
|
-
/**
|
|
52
|
-
* Sets memory only keys
|
|
53
|
-
*/
|
|
54
|
-
setMemoryOnlyKeys: () => void;
|
|
55
51
|
/**
|
|
56
52
|
* Gets the total bytes of the database file
|
|
57
53
|
*/
|