Repository navigation
Replies: 1 comment
|
A store setter already batches its internal updates, so this single call updates all four properties before dependent effects run: setO(produce(o => {
o.x = o.y = o.z = 11;
o.t = [11, 22, 33];
}));Your explicit Case 3 has a correctness problem: setO('t', produce(t => {
t.splice(0, t.length, 11, 22, 33);
}));Also, the case 2 |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
which one is faster? batch or produce?
Case 1
Case 2
Case 3
All reactions