Class Cache<CacheEntryType>

Type Parameters

  • CacheEntryType

Hierarchy

  • Cache

Constructors

  • Cache instance constructor

    Type Parameters

    • CacheEntryType

    Parameters

    • store: Store<StateWithCachePartition<CacheEntryType, CacheKeyType>>

      The @watchable/store!Store that will be used to hold the cache.

    • cachePartitonName: NotUndefined

      name of the partition in which to store the cached records.

    Returns Cache<CacheEntryType>

    @watchable/store!Store instance of the partition

Properties

partition: Store<CacheFolder<CacheEntryType, CacheKeyType>>

Methods

  • Adds an entry to this cache instance

    Parameters

    • cacheFolder: NotUndefined

      name of the category in which to store the cache records.

    • cacheId: NotUndefined

      the identifier of a cached entry.

    • entry: undefined | Immutable<CacheEntryType>

      the data to be cached.

    Returns void

  • Retrieves an entry from this cache instance

    Parameters

    • cacheFolder: NotUndefined

      name of the category in which the cached records are stored.

    • cacheId: NotUndefined

      the identifier of the cached entry.

    Returns undefined | Immutable<CacheEntryType>

    type of CacheEntryType generic

  • Getter for this Cache instance's store partition

    Returns Store<CacheFolder<CacheEntryType, CacheKeyType>>

    @watchable/store!Store instance of the partition

  • Adds an entry to a cache

    Type Parameters

    • CacheEntryType

    Parameters

    • store: Store<StateWithCachePartition<CacheEntryType, CacheKeyType>>

      The @watchable/store!Store that contains the cache.

    • cachePartitonName: NotUndefined

      The name of the partition where the cache resides.

    • cacheFolder: NotUndefined

      name of the category in which to store the cache records.

    • cacheId: NotUndefined

      the identifier of a cached entry.

    • entry: undefined | Immutable<CacheEntryType>

      the data to be cached.

    Returns void

  • A selector to return a cached entry from the store

    Type Parameters

    • CacheEntryType

    Parameters

    • state: CacheFolder<CacheEntryType, CacheKeyType>

      The @watchable/store!PartitionableState that has the state with cached entries.

    • cacheFolder: NotUndefined

      name of the category in which to store the cache records.

    • cacheId: NotUndefined

      the identifier of a cached entry.

    Returns undefined | CacheEntryType

  • A selector to return a cache partition

    Type Parameters

    • CacheEntryType

    Parameters

    • state: StateWithCachePartition<CacheEntryType, CacheKeyType>

      The @watchable/store!PartitionableState that has the cache partition.

    • cachePartitonName: NotUndefined

      The name of the partition where the cache resides.

    Returns undefined | CacheFolder<CacheEntryType, CacheKeyType>

  • Creates a partition to use as a cache store

    Type Parameters

    Parameters

    • store: Store<StateWithCachePartition<CacheEntryType, CachePartitionKey>>

      The @watchable/store!Store that will be partitioned.

    • cachePartitonName: NotUndefined

      name of the partition in which to store the cached records.

    Returns Store<StateWithCachePartition<CacheEntryType, CachePartitionKey>[CachePartitionKey]>

    @watchable/store!Store instance of the partition

  • Retrieves an entry from a cache

    Type Parameters

    • CacheEntryType

    Parameters

    • store: Store<StateWithCachePartition<CacheEntryType, CacheKeyType>>

      The @watchable/store!Store that contains the cache.

    • cachePartitonName: NotUndefined

      The name of the partition where the cache resides.

    • cacheFolder: NotUndefined

      name of the category in which the cached records are stored.

    • cacheId: NotUndefined

      the identifier of the cached entry.

    Returns undefined | Immutable<CacheEntryType>

    type of CacheEntryType generic

Generated using TypeDoc