Dexie.vip()
Sample
db.on('ready', function() {
return new Dexie.Promise(function (resolve, reject) {
// At this point we are still VIP:ed, but if we use an asynchronous
// api without encapsulating it in another Dexie.Promise, we will
// loose our VIP status. One example is when using setTimeout():
setTimeout(function(){
// Here we are no longer auto-VIP:et
// If we don't VIP ourselves here, database will be blocked for
// us because it is waiting for ourselves to finish! Deadlock will occur!
db.vip(function () {
// Make db calls here will ignore the blocked state of db:
db.friends.put({name: "Urban"}).then(resolve).catch(reject);
});
}, 0);
});
});Description
1. Dexie.open() is called