@expo/entity-cache-adapter-local-memory 0.55.0 → 0.57.0
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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expo/entity-cache-adapter-local-memory",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.57.0",
|
|
4
4
|
"description": "Cross-request local memory cache adapter for @expo/entity",
|
|
5
5
|
"files": [
|
|
6
6
|
"build",
|
|
@@ -28,13 +28,13 @@
|
|
|
28
28
|
"author": "Expo",
|
|
29
29
|
"license": "MIT",
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@expo/entity": "^0.
|
|
31
|
+
"@expo/entity": "^0.57.0"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@expo/entity-testing-utils": "^0.
|
|
34
|
+
"@expo/entity-testing-utils": "^0.57.0",
|
|
35
35
|
"@isaacs/ttlcache": "2.1.4",
|
|
36
36
|
"@jest/globals": "30.2.0",
|
|
37
37
|
"typescript": "5.9.3"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "e876cfb27bb9b0004d81b40c9067481e3e0c2beb"
|
|
40
40
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CacheStatus,
|
|
3
|
+
GenericEntityCacheAdapter,
|
|
3
4
|
IEntityGenericCacher,
|
|
4
5
|
SingleFieldHolder,
|
|
5
6
|
SingleFieldValueHolder,
|
|
@@ -23,12 +24,11 @@ describe(GenericLocalMemoryCacher, () => {
|
|
|
23
24
|
it('has correct caching behavior', async () => {
|
|
24
25
|
const entityCompanionProvider = createLocalMemoryTestEntityCompanionProvider();
|
|
25
26
|
const viewerContext = new ViewerContext(entityCompanionProvider);
|
|
26
|
-
const genericCacher =
|
|
27
|
-
LocalMemoryTestEntity
|
|
28
|
-
|
|
29
|
-
LocalMemoryTestEntityFields,
|
|
30
|
-
|
|
31
|
-
>;
|
|
27
|
+
const genericCacher = (
|
|
28
|
+
viewerContext.entityCompanionProvider.getCompanionForEntity(LocalMemoryTestEntity)[
|
|
29
|
+
'tableDataCoordinator'
|
|
30
|
+
]['cacheAdapter'] as GenericEntityCacheAdapter<LocalMemoryTestEntityFields, 'id'>
|
|
31
|
+
)['genericCacher'];
|
|
32
32
|
|
|
33
33
|
const date = new Date();
|
|
34
34
|
const entity1Created = await LocalMemoryTestEntity.creator(viewerContext)
|
|
@@ -105,7 +105,7 @@ describe(GenericLocalMemoryCacher, () => {
|
|
|
105
105
|
expect(entityNonExistentResult2.ok).toBe(false);
|
|
106
106
|
|
|
107
107
|
// invalidate from cache to ensure it invalidates correctly
|
|
108
|
-
await LocalMemoryTestEntity.
|
|
108
|
+
await LocalMemoryTestEntity.invalidationUtils(viewerContext).invalidateFieldsAsync(
|
|
109
109
|
entity1.getAllFields(),
|
|
110
110
|
);
|
|
111
111
|
const keys = genericCacher.makeCacheKeysForInvalidation(
|
|
@@ -121,12 +121,11 @@ describe(GenericLocalMemoryCacher, () => {
|
|
|
121
121
|
it('respects the parameters of a noop cache', async () => {
|
|
122
122
|
const entityCompanionProvider = createNoOpLocalMemoryIntegrationTestEntityCompanionProvider();
|
|
123
123
|
const viewerContext = new ViewerContext(entityCompanionProvider);
|
|
124
|
-
const genericCacher =
|
|
125
|
-
LocalMemoryTestEntity
|
|
126
|
-
|
|
127
|
-
LocalMemoryTestEntityFields,
|
|
128
|
-
|
|
129
|
-
>;
|
|
124
|
+
const genericCacher = (
|
|
125
|
+
viewerContext.entityCompanionProvider.getCompanionForEntity(LocalMemoryTestEntity)[
|
|
126
|
+
'tableDataCoordinator'
|
|
127
|
+
]['cacheAdapter'] as GenericEntityCacheAdapter<LocalMemoryTestEntityFields, 'id'>
|
|
128
|
+
)['genericCacher'];
|
|
130
129
|
const cacheKeyMaker = genericCacher['makeCacheKeyForStorage'].bind(genericCacher);
|
|
131
130
|
|
|
132
131
|
const date = new Date();
|