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.
- package/dist/gnim.gresource +0 -0
- package/dist/jsx/With.ts +8 -2
- package/dist/jsx/state.ts +3 -3
- package/package.json +1 -1
package/dist/gnim.gresource
CHANGED
|
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
|
-
|
|
56
|
+
const newValue = value.get()
|
|
57
|
+
if (currentValue === newValue) {
|
|
58
|
+
callback((currentValue = newValue))
|
|
59
|
+
}
|
|
56
60
|
})
|
|
57
|
-
|
|
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
|
|
239
|
-
if (cache[i] !==
|
|
240
|
-
cache[i] =
|
|
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) {
|