Redux: user action vs logic action -
let's have list , button. element of list can selected (only 1 @ time). if element selected, button changes a
, if not, changes b
.
my question is, should have button fire action_button_clicked
, reducer can figure out if it's supposed a
or b
based on it's current state (iselementselected
) or should button decide action fire, action_a
or action_b
?
obs.: button have it's text button(a)
or button(b)
based on whether element selected or not.
Comments
Post a Comment