0.35.0 • Published 1 month ago

@expo/entity-secondary-cache-local-memory v0.35.0

Weekly downloads
-
License
MIT
Repository
-
Last release
1 month ago

@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.

Documentation

Usage

  1. Create a concrete implementation of abstract class EntitySecondaryCacheLoader, in this example TestEntitySecondaryCacheLoader. The underlying data can come from anywhere, but an entity is constructed from the data and then authorized for the viewer.
  2. Create an instance of your EntitySecondaryCacheLoader, passing in a LocalMemorySecondaryEntityCache.
    const secondaryCacheLoader = new TestSecondaryLocalMemoryCacheLoader(
      new LocalMemorySecondaryEntityCache(
        GenericLocalMemoryCacher.createLRUCache<LocalMemoryTestEntityFields>({})
      ),
      LocalMemoryTestEntity.loader(viewerContext)
    );
  3. Load entities through it:
    const loadParams = { id: createdEntity.getID() };
    const results = await secondaryCacheLoader.loadManyAsync([loadParams]);
0.35.0

1 month ago

0.34.0

1 month ago

0.33.0

7 months ago

0.32.0

11 months ago

0.31.1

1 year ago

0.31.0

1 year ago

0.30.0

1 year ago

0.29.0

2 years ago

0.28.0

2 years ago

0.27.0

2 years ago

0.26.1

2 years ago

0.26.0

2 years ago

0.25.3

2 years ago

0.25.2

2 years ago

0.25.1

2 years ago

0.25.0

2 years ago