Skip to content

Class: FlyzeMemoryStorageProvider

@flyze/lib-core-angular 1.0.0-alpha.34· latest

Defined in: projects/lib-core-angular/src/lib/modules/storage/memory-storage.provider.ts:24

Keeps values in a Map for the lifetime of the instance: nothing is persisted, nothing survives a reload.

Useful as the inner provider in a spec, as an explicit “do not remember this” route, and as a fallback where persisting would be wrong (a kiosk, an embedded view).

Values are cloned on the way in and on the way out, so a caller mutating an object after writing it — or after reading it back — cannot reach what is stored. That matches the providers that serialize, which give the same isolation as a side effect.

Keys are stored as given: the fyz.v1. prefix is a tool for a shared namespace, and this map belongs to one instance.

new FlyzeMemoryStorageProvider(): FlyzeMemoryStorageProvider

FlyzeMemoryStorageProvider

FlyzeStorageProvider.constructor

delete(key): Promise<void>

Defined in: projects/lib-core-angular/src/lib/modules/storage/memory-storage.provider.ts:76

Drops the value held under a key.

string

The full key, prefix included.

Promise<void>

Resolves once dropped.

FlyzeStorageProvider.delete


read<T>(key): Promise<T>

Defined in: projects/lib-core-angular/src/lib/modules/storage/memory-storage.provider.ts:36

Reads a clone of the value held under a key.

T = unknown

string

The full key, prefix included.

Promise<T>

The stored value, or null if absent.

FlyzeStorageProvider.read


write(key, value): Promise<void>

Defined in: projects/lib-core-angular/src/lib/modules/storage/memory-storage.provider.ts:49

Holds a clone of a value under a key.

string

The full key, prefix included.

unknown

Any structured-cloneable value.

Promise<void>

Resolves once held, or once the write has been dropped.

FlyzeStorageProvider.write