问题
In Flux
, what is the point of using actions
, instead of just letting the component
publish directly to the dispatcher
? What is it that I can't do without actions
?
回答1:
The action creators decouple the component from the dispatcher. You could replace the dispatcher and related pieces with something else and the components would not need to change.
来源:https://stackoverflow.com/questions/29677779/react-flux-whats-the-point-of-actions