File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
6-data-storage/03-indexeddb Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 55
66# IndexedDB
77
8- IndexedDB is a database, that is built into browser, much more powerful than ` localStorage ` .
8+ IndexedDB is a database that is built into browser, much more powerful than ` localStorage ` .
99
1010- Stores almost any kind of values by keys, multiple key types.
1111- Supports transactions for reliability.
@@ -75,10 +75,10 @@ We can open it with version `2` and perform the upgrade like this:
7575``` js
7676let openRequest = indexedDB .open (" store" , * ! * 2 */ ! * );
7777
78- openRequest .onupgradeneeded = function () {
78+ openRequest .onupgradeneeded = function (event ) {
7979 // the existing database version is less than 2 (or it doesn't exist)
8080 let db = openRequest .result ;
81- switch (db . version ) { // existing db version
81+ switch (event . oldVersion ) { // existing db version
8282 case 0 :
8383 // version 0 means that the client had no database
8484 // perform initialization
You can’t perform that action at this time.
0 commit comments