dictKv()
Create an in-memory typed KV tier preloaded from a record.
Import
Section titled “Import”import { dictKv } from "@graphrefly/ts/storage";Signature
Section titled “Signature”function dictKv( entries: Record<string, T> = {}, codec: Codec<T> = jsonCodecFor<T>(),): KvStorageTier<T>Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
entries | Record<string, T> | entries value used by the helper. |
codec | Codec<T> | Codec used to encode and decode stored values. |
Returns
Section titled “Returns”A KvStorageTier<T> value.
Example
Section titled “Example”import { dictKv } from "@graphrefly/ts/storage";Source
Section titled “Source”packages/ts/src/storage/kv.ts