Skip to content

Instantly share code, notes, and snippets.

@luke-denton-aligent
Last active November 16, 2016 04:01
Show Gist options
  • Save luke-denton-aligent/b2648247d6028ca5df14beb319bf670e to your computer and use it in GitHub Desktop.
Save luke-denton-aligent/b2648247d6028ca5df14beb319bf670e to your computer and use it in GitHub Desktop.
This snippet shows how to add another value to the object store in IndexedDB
// Offline Web Applications course on Udacity https://classroom.udacity.com/courses/ud899
//Again, following on from https://gist.github.com/luke-denton/55be283cbddf6f0c0d362fd95fc9280a
dbPromise.then(function(db) {
var tx = db.transaction('keyval', 'readwrite');
var keyValStore = tx.objectStore('keyval');
keyValStore.put('bar', 'foo');
return tx.complete;
}).then(function() {
console.log("Success");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment