@solidjs/signals 0.8.0 → 0.8.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/dev.js CHANGED
@@ -831,8 +831,11 @@ function setSignal(el, v) {
831
831
  }
832
832
  clearStatusFlags(el);
833
833
  el._time = clock;
834
- for (let link2 = el._subs; link2 !== null; link2 = link2._nextSub) {
835
- insertIntoHeap(link2._sub, link2._sub._flags & 32 /* Zombie */ ? zombieQueue : dirtyQueue);
834
+ for (let s = el._subs; s !== null; s = s._nextSub) {
835
+ const queue = s._sub._flags & 32 /* Zombie */ ? zombieQueue : dirtyQueue;
836
+ if (queue._min > s._sub._height)
837
+ queue._min = s._sub._height;
838
+ insertIntoHeap(s._sub, queue);
836
839
  }
837
840
  schedule();
838
841
  return v;
@@ -2032,6 +2035,7 @@ var CollectionQueue = class extends Queue {
2032
2035
  _collectionType;
2033
2036
  _nodes = /* @__PURE__ */ new Set();
2034
2037
  _disabled = signal(false, { pureWrite: true });
2038
+ _initialized = false;
2035
2039
  constructor(type) {
2036
2040
  super();
2037
2041
  this._collectionType = type;
@@ -2041,8 +2045,14 @@ var CollectionQueue = class extends Queue {
2041
2045
  return;
2042
2046
  return super.run(type);
2043
2047
  }
2048
+ enqueue(type, fn) {
2049
+ if (this._collectionType & 1 /* Pending */ && this._initialized) {
2050
+ return this._parent?.enqueue(type, fn);
2051
+ }
2052
+ return super.enqueue(type, fn);
2053
+ }
2044
2054
  notify(node, type, flags) {
2045
- if (!(type & this._collectionType))
2055
+ if (!(type & this._collectionType) || this._collectionType & 1 /* Pending */ && this._initialized)
2046
2056
  return super.notify(node, type, flags);
2047
2057
  if (flags & this._collectionType) {
2048
2058
  this._nodes.add(node);
@@ -2083,7 +2093,8 @@ function createCollectionBoundary(type, fn, fallback) {
2083
2093
  if (!read(queue._disabled)) {
2084
2094
  const resolved = read(tree);
2085
2095
  if (!untrack(() => read(queue._disabled)))
2086
- return resolved;
2096
+ queue._initialized = true;
2097
+ return resolved;
2087
2098
  }
2088
2099
  return fallback(queue);
2089
2100
  });