Created
January 20, 2019 01:08
-
-
Save arackaf/ab3d8ca11c5cec64c1a26f7a1d376558 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 deleteItem(_id, table) { | |
let open = indexedDB.open("books", 1); | |
return new Promise(res => { | |
open.onsuccess = evt => { | |
let db = open.result; | |
let tran = db.transaction(table, "readwrite"); | |
let objStore = tran.objectStore(table); | |
objStore.delete(_id).onsuccess = res; | |
}; | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment