Last active
November 16, 2016 04:01
-
-
Save luke-denton-aligent/4c8e91c6c9b9ba2017aaa157ff50008a to your computer and use it in GitHub Desktop.
This snippet shows how to read from an object store in IndexedDB
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Offline Web Applications course on Udacity https://classroom.udacity.com/courses/ud899 | |
//Following on from https://gist.github.com/luke-denton/55be283cbddf6f0c0d362fd95fc9280a | |
dbPromise.then(function(db) { | |
var tx = db.transaction('keyval'); | |
var keyValStore = tx.objectStore('keyval'); | |
return keyValStore.get('hello'); | |
}).then(function(val) { | |
console.log(val); //Log the value of the key 'hello' | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment