Skip to content

Instantly share code, notes, and snippets.

@matthieu-D
Created November 11, 2016 03:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matthieu-D/ca826401b566c532eca715d9004fc9a3 to your computer and use it in GitHub Desktop.
Save matthieu-D/ca826401b566c532eca715d9004fc9a3 to your computer and use it in GitHub Desktop.
function readAll() {
let objectStore = db.transaction("name").objectStore("name");
let users = [];
objectStore.openCursor().onsuccess = function(event) {
let cursor = event.target.result;
if (cursor) {
users.push(cursor.value.name);
cursor.continue();
} else {
self.postMessage('Every users: ' + users.join(', '));
}
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment