Last active
September 3, 2016 18:38
-
-
Save Breta01/1f735a892b4ed90263092449fd1b1925 to your computer and use it in GitHub Desktop.
Implementing IndexedDB
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
/** Delete a stat **/ | |
mkDB.deleteStat = function(id, callback) { | |
var db = datastore; | |
var transaction = db.transaction(['stats'], 'readwrite'); | |
var objStore = transaction.objectStore('stats'); | |
//Delete stat by timestamp (id) | |
var request = objStore.delete(id); | |
request.onsuccess = function(e) { | |
callback(); | |
} | |
request.onerror = function(e) { | |
console.log(e); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment