DocsReference@proto-kit/moduleClassesInMemoryStateService

@proto-kit/moduleDocs


Documentation / @proto-kit/module / InMemoryStateService

Class: InMemoryStateService

Naive implementation of an in-memory variant of the StateService interface

Extended by

Implements

Constructors

new InMemoryStateService()

new InMemoryStateService(): InMemoryStateService

Returns

InMemoryStateService

Properties

values

values: Record<string, null | Field[]> = {}

This mapping container null values if the specific entry has been deleted. This is used by the CachedState service to keep track of deletions

Defined in

packages/module/src/state/InMemoryStateService.ts:12

Methods

get()

get(key): Promise<undefined | Field[]>

Parameters

key: Field

Returns

Promise<undefined | Field[]>

Implementation of

SimpleAsyncStateService.get

Defined in

packages/module/src/state/InMemoryStateService.ts:14


set()

set(key, value): Promise<void>

Parameters

key: Field

value: undefined | Field[]

Returns

Promise<void>

Implementation of

SimpleAsyncStateService.set

Defined in

packages/module/src/state/InMemoryStateService.ts:18