为什么在Redux-Saga上使用Redux-Observable? [英] Why use Redux-Observable over Redux-Saga?

查看:135
本文介绍了为什么在Redux-Saga上使用Redux-Observable?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用过 Redux-Saga 。用它编写的代码到目前为止很容易理解,除了JS生成器功能不时弄乱我的脑袋。根据我的理解, Redux-Observable 可以实现处理副作用但不使用生成器功能的类似工作。

I have used Redux-Saga. Code written with it is easy to reason so far, except JS generator function is messing up my head from time to time. From my understanding, Redux-Observable can achieve the similar job that handles side effects but without using generator function.

然而,来自Redux-Observable的文档并没有提供很多关于它为什么优于Redux-Saga的意见。我想知道是否使用生成器函数是使用Redux-Observable的唯一好处。使用Redux-Observable而不是Redux-Saga会有什么缺点,不足或妥协?在此先感谢。

However, docs from Redux-Observable does not provide many opinions of why it is superior against Redux-Saga. I would want to know whether not using generator function is the only benefit of using Redux-Observable. And what could be the downsides, gotcha or compromises from using Redux-Observable instead of Redux-Saga? Thanks in advance.

推荐答案

免责声明:我是redux-observable的作者之一,所以我很难成为100%公平。

Disclaimer: I am one of the authors of redux-observable so it's hard for me to be 100% impartial.

这篇关于为什么在Redux-Saga上使用Redux-Observable?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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