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.
package/dist/dexie.mjs CHANGED
@@ -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
  *
@@ -222,12 +222,6 @@ function cloneSimpleObjectTree(o) {
222
222
  }
223
223
  return rv;
224
224
  }
225
- function objectIsEmpty(o) {
226
- for (var k in o)
227
- if (hasOwn(o, k))
228
- return false;
229
- return true;
230
- }
231
225
  var circularRefs = null;
232
226
  function deepClone(any) {
233
227
  circularRefs = new WeakMap();
@@ -1138,7 +1132,7 @@ function tempTransaction(db, mode, storeNames, fn) {
1138
1132
  }
1139
1133
  }
1140
1134
 
1141
- var DEXIE_VERSION = '4.4.0';
1135
+ var DEXIE_VERSION = '4.4.1';
1142
1136
  var maxString = String.fromCharCode(65535);
1143
1137
  var minKey = -Infinity;
1144
1138
  var INVALID_KEY_ARGUMENT = "Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.";
@@ -5856,22 +5850,32 @@ function liveQuery(querier) {
5856
5850
  signal: abortController.signal,
5857
5851
  requery: doQuery,
5858
5852
  querier: querier,
5859
- trans: null
5853
+ trans: null,
5860
5854
  };
5861
5855
  var ret = execute(ctx);
5856
+ if (!startedListening) {
5857
+ globalEvents(DEXIE_STORAGE_MUTATED_EVENT_NAME, mutationListener);
5858
+ startedListening = true;
5859
+ }
5862
5860
  Promise.resolve(ret).then(function (result) {
5863
5861
  hasValue = true;
5864
5862
  currentValue = result;
5865
5863
  if (closed || ctx.signal.aborted) {
5866
5864
  return;
5867
5865
  }
5868
- accumMuts = {};
5869
- currentObs = subscr;
5870
- if (!objectIsEmpty(currentObs) && !startedListening) {
5871
- globalEvents(DEXIE_STORAGE_MUTATED_EVENT_NAME, mutationListener);
5872
- startedListening = true;
5866
+ if (shouldNotify()) {
5867
+ doQuery();
5868
+ }
5869
+ else {
5870
+ currentObs = subscr;
5871
+ if (shouldNotify()) {
5872
+ doQuery();
5873
+ }
5874
+ else {
5875
+ accumMuts = {};
5876
+ execInGlobalContext(function () { return !closed && observer.next && observer.next(result); });
5877
+ }
5873
5878
  }
5874
- execInGlobalContext(function () { return !closed && observer.next && observer.next(result); });
5875
5879
  }, function (err) {
5876
5880
  hasValue = false;
5877
5881
  if (!['DatabaseClosedError', 'AbortError'].includes(err === null || err === void 0 ? void 0 : err.name)) {