solid-ctrl-flow 2.2.4 → 2.2.5

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/index.d.ts CHANGED
@@ -134,7 +134,8 @@ export declare class OrderedLinkedList<T> {
134
134
  /** Yields all the elements PAST the current */
135
135
  [Symbol.iterator](): Generator<T>;
136
136
  /**
137
- * Adds a node to the list in order
137
+ * Adds a node to the list in order.
138
+ * If two nodes have the same order, it would have been more efficient to put the latest one first, but this would not have been ok, since we also want to order by insertion time
138
139
  * @param node The node to add
139
140
  * @param comp The comparison function to use
140
141
  * @returns The same value as {@link node}
package/dist/index.mjs CHANGED
@@ -61,14 +61,15 @@ class OrderedLinkedList {
61
61
  yield* next;
62
62
  }
63
63
  /**
64
- * Adds a node to the list in order
65
- * @param node The node to add
66
- * @param comp The comparison function to use
67
- * @returns The same value as {@link node}
68
- */
64
+ * Adds a node to the list in order.
65
+ * If two nodes have the same order, it would have been more efficient to put the latest one first, but this would not have been ok, since we also want to order by insertion time
66
+ * @param node The node to add
67
+ * @param comp The comparison function to use
68
+ * @returns The same value as {@link node}
69
+ */
69
70
  add(node, comp) {
70
71
  const { next } = this;
71
- if (next && comp(node.value, next.value) > 0)
72
+ if (next && comp(node.value, next.value) >= 0)
72
73
  return next.add(node, comp);
73
74
  this.next = node;
74
75
  node.prev = this;
@@ -194,7 +195,10 @@ function Source(props) {
194
195
  };
195
196
  const node = new OrderedLinkedListNode(info);
196
197
  createRenderEffect(on(order, () => {
197
- onCleanup(() => node.remove());
198
+ onCleanup(() => {
199
+ node.remove();
200
+ state.force();
201
+ });
198
202
  sources.add(node, COMPARATOR);
199
203
  state.force();
200
204
  }));
package/dist/index.umd.js CHANGED
@@ -64,14 +64,15 @@
64
64
  yield* next;
65
65
  }
66
66
  /**
67
- * Adds a node to the list in order
68
- * @param node The node to add
69
- * @param comp The comparison function to use
70
- * @returns The same value as {@link node}
71
- */
67
+ * Adds a node to the list in order.
68
+ * If two nodes have the same order, it would have been more efficient to put the latest one first, but this would not have been ok, since we also want to order by insertion time
69
+ * @param node The node to add
70
+ * @param comp The comparison function to use
71
+ * @returns The same value as {@link node}
72
+ */
72
73
  add(node, comp) {
73
74
  const { next } = this;
74
- if (next && comp(node.value, next.value) > 0)
75
+ if (next && comp(node.value, next.value) >= 0)
75
76
  return next.add(node, comp);
76
77
  this.next = node;
77
78
  node.prev = this;
@@ -197,7 +198,10 @@
197
198
  };
198
199
  const node = new OrderedLinkedListNode(info);
199
200
  solidJs.createRenderEffect(solidJs.on(order, () => {
200
- solidJs.onCleanup(() => node.remove());
201
+ solidJs.onCleanup(() => {
202
+ node.remove();
203
+ state.force();
204
+ });
201
205
  sources.add(node, COMPARATOR);
202
206
  state.force();
203
207
  }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "solid-ctrl-flow",
3
- "version": "2.2.4",
3
+ "version": "2.2.5",
4
4
  "description": "Control flow components for solid-js",
5
5
  "author": "AFatNiBBa",
6
6
  "license": "ISC",