Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
242 changes: 242 additions & 0 deletions guides/user-experience/persist-structured-data/demo.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions guides/user-experience/persist-structured-data/expectations.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
- `indexedDB.open()` is called with a database name and a numeric version.
- Object stores are created inside the `upgradeneeded` event handler using `createObjectStore()`.
- At least one index is created with `createIndex()` for efficient querying.
- Data reads use `"readonly"` transactions; data writes use `"readwrite"` transactions.
- IndexedDB operations are wrapped in Promises for ergonomic async/await usage.
- The `versionchange` event is handled on the database connection to close it when another tab upgrades.
- `put()` is used for insert-or-update operations; `add()` is used when duplicate keys should error.
- Error handling is present on transactions or requests (e.g., `onerror` handlers or Promise rejections).
- Sensitive data (tokens, passwords) is NOT stored in IndexedDB without encryption.
- Simple string key-value storage does NOT use IndexedDB when `localStorage` would suffice.
Loading
Loading