Comparing version 0.1.57 to 0.1.58
{ | ||
"name": "webdetta", | ||
"version": "0.1.57", | ||
"version": "0.1.58", | ||
"author": "Fedot Kriutchenko <fodyadev@gmail.com>", | ||
@@ -5,0 +5,0 @@ "description": "", |
@@ -13,4 +13,4 @@ import { Context } from '../common/context.js'; | ||
(handler.sideEffects ??= []).push(postponed); | ||
return; | ||
} | ||
if (handler) return; | ||
@@ -71,5 +71,5 @@ const currList = list; | ||
const handler = throttle.sync(() => { | ||
const ctx = { func: handler, sideEffects: null }; | ||
const ctx = { func: handler, sideEffects: [] }; | ||
const res = currentHandler.run(ctx, func, []); | ||
if (ctx.sideEffects) for (const func of ctx.sideEffects) func(); | ||
for (const func of ctx.sideEffects) func(); | ||
return res; | ||
@@ -92,4 +92,3 @@ }); | ||
} | ||
let saved; | ||
r.effect(() => changed() ? (saved = func(...values)) : saved); | ||
r.effect(() => changed() && func(...values)); | ||
} | ||
@@ -96,0 +95,0 @@ const derive = func => { |
137398
3988