I am using Flutter redux for state management and what I don't understand is why do we have both StoreConnector
and StoreBuilder
?
What is the difference between the two, other than the parameters they except?
Is there a specific reason as to when should we use any one of them?
The difference is basically on the scope of changes.
I'd recommend for the StoreConnector
pretty much every time, except for very simple cases.
StoreBuilder
always listens on the entire store. StoreConnector
converts the store to a widget-specific viewmodel; this is what lets redux be smart about what parts of the tree need be updated when the store changes.
If you have StoreBuilders
everywhere, all of them will be updated every time there is a change in the store.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With