From 0e8e6f369d2fe37237361ac26646b976f600d786 Mon Sep 17 00:00:00 2001 From: Ilya Kantor Date: Fri, 28 Jun 2019 12:17:35 +0300 Subject: [PATCH] minor --- 6-data-storage/03-indexeddb/article.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/6-data-storage/03-indexeddb/article.md b/6-data-storage/03-indexeddb/article.md index b4bbe5e8..0212fc95 100644 --- a/6-data-storage/03-indexeddb/article.md +++ b/6-data-storage/03-indexeddb/article.md @@ -799,12 +799,11 @@ IndexedDB can be thought of as a "localStorage on steroids". It's a simple key-v 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. -The usage can be described with a few phrases: +The basic usage can be described with a few phrases: 1. Get a promise wrapper like [idb](https://github.com/jakearchibald/idb). 2. Open a database: `idb.openDb(name, version, onupgradeneeded)` - - Create object storages in indexes in `onupgradeneeded` handlers. - - Update version if needed - either by comparing numbers or just checking what exists. + - Create object storages and indexes in `onupgradeneeded` handler or perform version update if needed. 3. For requests: - Create transaction `db.transaction('books')` (readwrite if needed). - Get the object store `transaction.objectStore('books')`.