Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit fd85fc5

Browse files
Fix possible typos in 6.3 (IndexedDB)
1 parent e1a3f63 commit fd85fc5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

‎6-data-storage/03-indexeddb/article.md‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ let openRequest = indexedDB.open(name, version);
3434
We can have many databases with different names, but all of them exist within the current origin (domain/protocol/port). Different websites can't access each other's databases.
3535

3636
The call returns `openRequest` object, we should listen to events on it:
37-
- `success`: database is ready, there's the "database object" in `openRequest.result`, that we should use it for further calls.
37+
- `success`: database is ready, there's the "database object" in `openRequest.result`, we should use it for further calls.
3838
- `error`: opening failed.
3939
- `upgradeneeded`: database is ready, but its version is outdated (see below).
4040

@@ -117,7 +117,7 @@ Let's say:
117117
2. Then we rolled out an update, so our code is newer.
118118
3. And then the same visitor opens our site in another tab.
119119

120-
So there's a tab with an open connection to DB version `1`, while the second tab one attempts to update it to version `2` in its `upgradeneeded` handler.
120+
So there's a tab with an open connection to DB version `1`, while the second one attempts to update it to version `2` in its `upgradeneeded` handler.
121121

122122
The problem is that a database is shared between two tabs, as it's the same site, same origin. And it can't be both version `1` and `2`. To perform the update to version `2`, all connections to version 1 must be closed, including the one in the first tab.
123123

@@ -153,7 +153,7 @@ openRequest.onblocked = function() {
153153
// this event shouldn't trigger if we handle onversionchange correctly
154154

155155
// it means that there's another open connection to same database
156-
// and it wasn't closed after db.onversionchange triggered for them
156+
// and it wasn't closed after db.onversionchange triggered for it
157157
};
158158
*/!*
159159
```
@@ -687,7 +687,7 @@ Whether there are more values matching the cursor or not -- `onsuccess` gets cal
687687

688688
In the example above the cursor was made for the object store.
689689

690-
But we also can make a cursor over an index. As we remember, indexes allow to search by an object field. Cursors over indexes to precisely the same as over object stores -- they save memory by returning one value at a time.
690+
But we also can make a cursor over an index. As we remember, indexes allow to search by an object field. Cursors over indexes do precisely the same as over object stores -- they save memory by returning one value at a time.
691691

692692
For cursors over indexes, `cursor.key` is the index key (e.g. price), and we should use `cursor.primaryKey` property for the object key:
693693

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /