Listener on multiple capsules updated from transaction #101
-
Hi, I'm listening two capsules that are being updated together in a transaction. The listener it's getting executed only once. Is this normal? For me is good this behaviour, but I want to understand it and know if it is correct. // Listening to data module
_cancelDataModuleListener = cc.listen((use) {
use(votePersonalCachedCapsule);
use(voteOverallCachedCapsule);
forceUpdate();
}); I ask this because I were expecting it to be executed twice. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Yes! That is entirely the point of transactions--to update multiple possibly unrelated points of data together into one rebuild sweep. The singular rebuild resulting from a transaction is a behavior you can depend on and won't change. |
Beta Was this translation helpful? Give feedback.
Yes! That is entirely the point of transactions--to update multiple possibly unrelated points of data together into one rebuild sweep. The singular rebuild resulting from a transaction is a behavior you can depend on and won't change.