useIndexedDB

Hook

Key/value store backed by IndexedDB. Returns setItem, getItem, removeItem, clear, and getAllKeys. Auto-creates the database and object store on first use.

core/use-indexed-db

Installation

1 · Add registry to components.json

2 · Install component

Examples

Key/value store

Data persists across sessions in IndexedDB.

No entries yet. Save one above.

API Reference

PropTypeDescription
databaseNamereq
stringIndexedDB database name.
storeNamereq
stringObject store name within the database.
options
UseIndexedDBOptionsOptional version number and upgrade callback.