-
-
Notifications
You must be signed in to change notification settings - Fork 683
Dexie.fakeAutoComplete()
David Fahlander edited this page May 6, 2014
·
3 revisions
Helps IDE know how you will call your callback.
function callMeBack (callback) {
Dexie.fakeAutoComplete(function() {
callback ([new Date()]);
});
}
Then, in your IDE, you write:
callMeBack (function (a) {
a._ // Here the IDE will know that a is an array of Date objects and autoComplete array methods as you type
}
The function simply calls setTimeout(yourFunction) and then immediately calls clearTimeout(handle).
Doing a loop of 100,000 calls to fakeAutoComplete() will result in the same time consumption as setting a property to an object twice. It is extreemely fast.
Dexie.js - minimalistic and bullet proof indexedDB library