mirror of
https://github.com/centau/vide.git
synced 2026-08-20 14:41:37 +00:00
fix: mark node validity before effect
- still is possible recursive effects if bump update id (expected) - fix some edge cases of undesirable queuing evaluating nodes
This commit is contained in:
parent
f510fdf690
commit
3478640636
1 changed files with 2 additions and 2 deletions
|
|
@ -163,6 +163,8 @@ local update_queue = { n = 0 } :: { n: number, [number]: Node<any> }
|
||||||
|
|
||||||
local function evaluate_node<T>(node: Node<T>)
|
local function evaluate_node<T>(node: Node<T>)
|
||||||
if node.higher_parent_update_id == node.last_eval_update_id then return node.needs_queue_children end
|
if node.higher_parent_update_id == node.last_eval_update_id then return node.needs_queue_children end
|
||||||
|
node.last_eval_update_id = update_id
|
||||||
|
|
||||||
local cur_value = node.cache
|
local cur_value = node.cache
|
||||||
|
|
||||||
flush_cleanups(node)
|
flush_cleanups(node)
|
||||||
|
|
@ -180,8 +182,6 @@ local function evaluate_node<T>(node: Node<T>)
|
||||||
|
|
||||||
local needs_queue_children = not is_similar(cur_value, new_value)
|
local needs_queue_children = not is_similar(cur_value, new_value)
|
||||||
node.needs_queue_children = needs_queue_children
|
node.needs_queue_children = needs_queue_children
|
||||||
|
|
||||||
node.last_eval_update_id = update_id
|
|
||||||
node.cache = new_value
|
node.cache = new_value
|
||||||
|
|
||||||
return needs_queue_children
|
return needs_queue_children
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue