Dexie.on.storagemutated
Syntax
const listener = (changedParts: ObservabilitySet) => {
console.log("Changed parts", changedParts);
};
// Subscribe:
Dexie.on("storagemutated", listener);
// Unsubscribe:
Dexie.on("storagemutated").unsubscribe(listener);
// Trigger:
Dexie.on("storagemutated").fire(changeParts: ObservabilitySet);Description
ObservabilitySet
/** Set of mutated parts of the database
*/
export type ObservabilitySet = {
/** Database part having been mutated.
*
* This structure is produced in observability-middleware.ts
* and consumed in live-query.ts.
*
* Format of 'part':
*
* `idb://${dbName}/${tableName}/${indexName}`
*
* * dbName is the database name
* * tableName is the table name
* * indexName is any of:
* 1. An empty string - represents the primary keys of the affected objs
* 2. ":dels" - represents primary keys of deleted objects in the table
* 3. The keyPath of an index, such as "name", "age" or "address.city" -
* represents indexes that, if used in a query, might affect the
* result of that query.
*
* IntervalTree
* * See definition of IntervalTree type in rangeset.d.ts
* * See rangesOverlap() in rangeset.ts that can be used to compare two
* IntervalTrees and detect collisions.
* * See RangeSet class that can be used to create an IntervalTree and add
* ranges to it.
*/
[part: string]: IntervalTree;
};