Home > widget-integration > FilterStore > hasCacheEntry

FilterStore.hasCacheEntry() method

Checks whether a specific cache entry exists.

Signature:

hasCacheEntry(key: string): boolean;

Parameters

Parameter

Type

Description

key

string

The cache key to check for existence

Returns:

boolean

True if the cache contains an entry with this key, false otherwise

Example

if (filterStore.hasCacheEntry('filter-v1-cat:shoes')) {
  const cached = filterStore.getCacheEntry('filter-v1-cat:shoes');
} else {
  // Fetch fresh data
}