API ReferenceFunctions
idbGet
Function: idbGet()
function idbGet<T>(
sandbox: Sandbox,
dbName: string,
storeName: string,
key: string): Promise<T | undefined>;Defined in: storage/idb-utils.ts:168
Read a value from the given Sandbox's IndexedDB at (dbName, storeName, key).
Type Parameters
| Type Parameter | Default type | Description |
|---|---|---|
T | unknown | The value type stored at this key. |
Parameters
| Parameter | Type | Description |
|---|---|---|
sandbox | Sandbox | The Sandbox whose IDB shim handles the read. |
dbName | string | IndexedDB database name. |
storeName | string | Object store name within the database. Created on first use if absent. |
key | string | Record key within the object store. |
Returns
Promise<T | undefined>
The stored value, or undefined if absent.
Example
const identity = await idbGet<{ pub: Uint8Array }>(sandbox, "snapcap", "fidelius", "identity");