Game Development Reference
In-Depth Information
Using Google Chrome's developer tools, we can see all of the databases and data
stores we have created for our domain. Note that the primary object key, which has
whatever name we give it during the creation of our data store, has IndexedDB-gen-
erated values, which, as we have specified, are incremented over the last value.
With this simple, yet verbose boilerplate code in place, we can now start using our
databases and data stores. From this point on, the actions we take on the database
will be done on the individual data store objects, which are accessed through the
database objects that created them.
IDBTransaction
The last general thing we need to remember when dealing with IndexDB, is that
every interaction we have with the data store is done inside transactions. If
something goes wrong during a transaction, the entire transaction is rolled back, and
nothing takes effect. Similarly, if the transaction is successful, IndexedDB will auto-
matically commit the transaction for us, which is a pretty handy bonus.
Search WWH ::




Custom Search