Skip to content

Class: SharedInMemoryCache

nekte-protocol


nekte-protocol / client/src / SharedInMemoryCache

Class: SharedInMemoryCache

Defined in: nekte-source/packages/client/src/shared-cache.ts:50

In-memory shared cache with invalidation notifications.

Implements

Constructors

Constructor

new SharedInMemoryCache(config?): SharedInMemoryCache

Defined in: nekte-source/packages/client/src/shared-cache.ts:54

Parameters

config?

InMemoryStoreConfig

Returns

SharedInMemoryCache

Accessors

size

Get Signature

get size(): number

Defined in: nekte-source/packages/client/src/shared-cache.ts:74

Current store size

Returns

number

Methods

clear()

clear(): void

Defined in: nekte-source/packages/client/src/shared-cache.ts:79

Clear the entire shared store

Returns

void


notifyInvalidation()

notifyInvalidation(key): void

Defined in: nekte-source/packages/client/src/shared-cache.ts:67

Notify all subscribers of an invalidation

Parameters

key

string

Returns

void

Implementation of

SharedCache.notifyInvalidation


onInvalidate()

onInvalidate(callback): () => void

Defined in: nekte-source/packages/client/src/shared-cache.ts:62

Subscribe to invalidation events

Parameters

callback

(key) => void

Returns

() => void

Implementation of

SharedCache.onInvalidate


store()

store(): CacheStore

Defined in: nekte-source/packages/client/src/shared-cache.ts:58

Get the shared backing store

Returns

CacheStore

Implementation of

SharedCache.store