Core · class

MemoryStore

Volatile store: the test double, and the fallback when nothing persists.

Explained in The loop.

class MemoryStore implements KeyValueStore
import { MemoryStore } from '@driftengine/core';

Methods

read

read(key: string): string | null
ParameterTypeDescription
keystring

write

write(key: string, value: string): void
ParameterTypeDescription
keystring
valuestring

remove

remove(key: string): void
ParameterTypeDescription
keystring

hydrate

hydrate(entries: Iterable<readonly [string, string]>): void

Seed from an asynchronous backend before anything reads.

ParameterTypeDescription
entriesIterable<readonly [string, string]>