dexie 4.4.0 → 4.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,7 +4,7 @@
4
4
  *
5
5
  * By David Fahlander, david.fahlander@gmail.com
6
6
  *
7
- * Version 4.4.0, Wed Mar 18 2026
7
+ * Version 4.4.1, Wed Mar 25 2026
8
8
  *
9
9
  * https://dexie.org
10
10
  *
@@ -185,12 +185,6 @@ function cloneSimpleObjectTree(o) {
185
185
  }
186
186
  return rv;
187
187
  }
188
- function objectIsEmpty(o) {
189
- for (const k in o)
190
- if (hasOwn(o, k))
191
- return false;
192
- return true;
193
- }
194
188
  let circularRefs = null;
195
189
  function deepClone(any) {
196
190
  circularRefs = new WeakMap();
@@ -1096,7 +1090,7 @@ function tempTransaction(db, mode, storeNames, fn) {
1096
1090
  }
1097
1091
  }
1098
1092
 
1099
- const DEXIE_VERSION = '4.4.0';
1093
+ const DEXIE_VERSION = '4.4.1';
1100
1094
  const maxString = String.fromCharCode(65535);
1101
1095
  const minKey = -Infinity;
1102
1096
  const INVALID_KEY_ARGUMENT = "Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.";
@@ -5724,22 +5718,32 @@ function liveQuery(querier) {
5724
5718
  signal: abortController.signal,
5725
5719
  requery: doQuery,
5726
5720
  querier,
5727
- trans: null
5721
+ trans: null,
5728
5722
  };
5729
5723
  const ret = execute(ctx);
5724
+ if (!startedListening) {
5725
+ globalEvents(DEXIE_STORAGE_MUTATED_EVENT_NAME, mutationListener);
5726
+ startedListening = true;
5727
+ }
5730
5728
  Promise.resolve(ret).then((result) => {
5731
5729
  hasValue = true;
5732
5730
  currentValue = result;
5733
5731
  if (closed || ctx.signal.aborted) {
5734
5732
  return;
5735
5733
  }
5736
- accumMuts = {};
5737
- currentObs = subscr;
5738
- if (!objectIsEmpty(currentObs) && !startedListening) {
5739
- globalEvents(DEXIE_STORAGE_MUTATED_EVENT_NAME, mutationListener);
5740
- startedListening = true;
5734
+ if (shouldNotify()) {
5735
+ doQuery();
5736
+ }
5737
+ else {
5738
+ currentObs = subscr;
5739
+ if (shouldNotify()) {
5740
+ doQuery();
5741
+ }
5742
+ else {
5743
+ accumMuts = {};
5744
+ execInGlobalContext(() => !closed && observer.next && observer.next(result));
5745
+ }
5741
5746
  }
5742
- execInGlobalContext(() => !closed && observer.next && observer.next(result));
5743
5747
  }, (err) => {
5744
5748
  hasValue = false;
5745
5749
  if (!['DatabaseClosedError', 'AbortError'].includes(err?.name)) {