gnim 1.8.0 → 1.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.
Binary file
package/dist/jsx/With.ts CHANGED
@@ -26,6 +26,7 @@ export function With<T, E extends JSX.Element>({
26
26
  const currentScope = getScope()
27
27
  const fragment = new Fragment<E>()
28
28
 
29
+ let currentValue: T
29
30
  let scope: Scope
30
31
 
31
32
  function remove(child: E) {
@@ -52,9 +53,14 @@ export function With<T, E extends JSX.Element>({
52
53
  }
53
54
 
54
55
  const dispose = value.subscribe(() => {
55
- callback(value.get())
56
+ const newValue = value.get()
57
+ if (currentValue === newValue) {
58
+ callback((currentValue = newValue))
59
+ }
56
60
  })
57
- callback(value.get())
61
+
62
+ currentValue = value.get()
63
+ callback(currentValue)
58
64
 
59
65
  onCleanup(() => {
60
66
  dispose()
package/dist/jsx/state.ts CHANGED
@@ -235,9 +235,9 @@ function createComputedArgs<
235
235
  if (subscribers.size === 0) {
236
236
  dispose = deps.map((dep, i) =>
237
237
  dep.subscribe(() => {
238
- const newValue = dep.get()
239
- if (cache[i] !== newValue) {
240
- cache[i] = dep.get()
238
+ const newDepValue = dep.get()
239
+ if (cache[i] !== newDepValue) {
240
+ cache[i] = newDepValue
241
241
 
242
242
  const newValue = compute()
243
243
  if (value !== newValue) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gnim",
3
- "version": "1.8.0",
3
+ "version": "1.8.1",
4
4
  "type": "module",
5
5
  "author": "Aylur",
6
6
  "license": "MIT",