React Flux: what's the point of actions?

浪子不回头ぞ 提交于 2019-12-10 11:24:31

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!