React Flux:行动的重点是什么? [英] React Flux: what's the point of actions?

查看:87
本文介绍了React Flux:行动的重点是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Flux 中,使用操作的重点是什么,而不只是让 component 直接发布到调度程序?如果没有行动,我不能做什么?

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?

推荐答案

动作创建者将组件与调度程序分离。您可以使用其他内容替换调度程序和相关部分,并且组件不需要更改。

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.

这篇关于React Flux:行动的重点是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆