LocalDataStore
A local store holds structured-cloneable values; it never writes to the vault.
Import:
import { LocalDataStore } from '@mnaoumov/obsidian-lib/data-stores/local-data-store';Signature:
export class LocalDataStoreMethods
| Method | Returns | Description |
|---|---|---|
| clear() | Promise<void> | Deletes every record in this store only. |
| close() | void | Closes this connection without deleting its records. Every later operation rejects with LocalDataStoreClosedError. Closing twice is harmless. |
| commit(params) | Promise<void> | Commits several record changes atomically without serializing the rest of the database. |
| delete(key) | Promise<void> | Deletes a record. |
| entries() | Promise<[string, unknown][]> | Reads all records in key order. |
| exclusive(callback) | Promise<T> | Serializes a shared-store operation across connections, windows and bundled library copies. |
| get(key) | Promise<unknown> | Reads a record. |
| getOrCreate(key, value) | Promise<unknown> | Initializes a record once, atomically across connections. |
| set(key, value) | Promise<void> | Writes a structured-cloneable value. |
| static open(params) | Promise<LocalDataStore> | Opens an isolated database. Writes resolve only once their transaction commits. |
Links to this page: