You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 6-data-storage/03-indexeddb/article.md
+2-3Lines changed: 2 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -799,12 +799,11 @@ IndexedDB can be thought of as a "localStorage on steroids". It's a simple key-v
799
799
800
800
The best manual is the specification, [the current one](https://w3c.github.io/IndexedDB) is 2.0, but few methods from [3.0](https://w3c.github.io/IndexedDB/) (it's not much different) are partially supported.
801
801
802
-
The usage can be described with a few phrases:
802
+
The basic usage can be described with a few phrases:
803
803
804
804
1. Get a promise wrapper like [idb](https://github.com/jakearchibald/idb).
805
805
2. Open a database: `idb.openDb(name, version, onupgradeneeded)`
806
-
- Create object storages in indexes in `onupgradeneeded` handlers.
807
-
- Update version if needed - either by comparing numbers or just checking what exists.
806
+
- Create object storages and indexes in `onupgradeneeded` handler or perform version update if needed.
808
807
3. For requests:
809
808
- Create transaction `db.transaction('books')` (readwrite if needed).
810
809
- Get the object store `transaction.objectStore('books')`.
0 commit comments