Created
November 11, 2016 03:46
-
-
Save matthieu-D/ca826401b566c532eca715d9004fc9a3 to your computer and use it in GitHub Desktop.
This file contains 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
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