0.38.0 • Published 1 year ago
@expo/entity-secondary-cache-local-memory v0.38.0
@expo/entity-secondary-cache-local-memory
Cross-request LRU secondary cache for @expo/entity
. Use
this cache with caution - it is nonstandard. The cache is shared between requests in the node process.
Usage
- Create a concrete implementation of abstract class
EntitySecondaryCacheLoader
, in this exampleTestEntitySecondaryCacheLoader
. The underlying data can come from anywhere, but an entity is constructed from the data and then authorized for the viewer. - Create an instance of your
EntitySecondaryCacheLoader
, passing in aLocalMemorySecondaryEntityCache
.const secondaryCacheLoader = new TestSecondaryLocalMemoryCacheLoader( new LocalMemorySecondaryEntityCache( GenericLocalMemoryCacher.createLRUCache<LocalMemoryTestEntityFields>({}) ), LocalMemoryTestEntity.loader(viewerContext) );
- Load entities through it:
const loadParams = { id: createdEntity.getID() }; const results = await secondaryCacheLoader.loadManyAsync([loadParams]);
0.38.0
1 year ago
0.37.0
1 year ago
0.36.0
1 year ago
0.35.0
1 year ago
0.34.0
1 year ago
0.33.0
2 years ago
0.32.0
2 years ago
0.31.1
2 years ago
0.31.0
2 years ago
0.30.0
3 years ago
0.29.0
3 years ago
0.28.0
3 years ago
0.27.0
3 years ago
0.26.1
3 years ago
0.26.0
3 years ago
0.25.3
3 years ago
0.25.2
3 years ago
0.25.1
3 years ago
0.25.0
3 years ago