简体   繁体   English

RxSwift 4 / RxCocoa 4弃用变量-优点和缺点

[英]RxSwift 4/RxCocoa 4 Deprecating Variable - pros and cons

In the future, Variable will be deprecated in RxSwift 4. Instead, Relay classes were first implemented in RxCocoa 4, and an alternate proposed to Variable is BehaviorRelay. 将来,在RxSwift 4中将不推荐使用Variable。相反,在RxCocoa 4中首先实现了Relay类,而对Variable提出的另一种选择是BehaviorRelay。

Assigning the value of a Variable is an imperative programming-style command. 分配变量的值是命令式编程命令。 Its convenient but not belongs in Reactive's declarative programming environment. 它方便但不属于Reactive的声明性编程环境。

What are their pros and cons? 他们的优缺点是什么?

我建议您阅读这篇文章 (或者可能是所有主题),以找到有关VariableDriver一些用户友好解释。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM