Replies: 3 comments 1 reply
-
It depends on rendering implementation and optimizations of your framework. So the best practice is to set new value for entire store once, instead of changing children items one by one. |
Beta Was this translation helpful? Give feedback.
-
The best way is to batch on UI framework side. React, Vue, Svelte do it. |
Beta Was this translation helpful? Give feedback.
-
I'm using React. |
Beta Was this translation helpful? Give feedback.
-
I have a tree data model where each node has a boolean state, i.e.
expanded
. So, I'd define it like this:(Don't know the actual type of value
atom
function returns, so just using a generic pseudoAtom
type).Now I want to define
expandAll
function that would take a root node and set all the nested node states totrue
:How to batch such updates? I don't want my TreeView component to re-render until all nodes expanded.
Beta Was this translation helpful? Give feedback.
All reactions