Dexie.addons
This array contains functions that add functionality to Dexie. An addon may register itself in Dexie.addons by using Dexie.addons.push(fn). Example:
import Dexie from 'dexie';
export function ForEachAddon (db) {
// Makes it possible to use forEach() instead of each() on collections.
db.Collection.prototype.forEach = db.Collection.prototype.each;
}
// Register the addon to be included by default (optional)
Dexie.addons.push(ForEachAddon);ES5:
(function(){
function ForEachAddon (db) {
// Makes it possible to use forEach() instead of each() on collections.
db.Collection.prototype.forEach = db.Collection.prototype.each;
}
// Register the addon to be included by default (optional)
Dexie.addons.push(ForEachAddon);
})();Using addons
Addons that register themselves to Dexie.addons (For example Dexie.Observable and Dexie.Syncable)
ES5: