首页 > 解决方案 > Do 和 Map 有什么区别?

问题描述

do运营商和运营商有什么区别map似乎是一样的。我正在学习 RxSwift。

请检查 do 和 map 的大理石图。

做:http ://reactivex.io/documentation/operators/do.html

地图:http ://reactivex.io/documentation/operators/map.html

标签: iosswiftreactive-programmingrx-swiftreactive

解决方案


除了 SPatel 提到的,

do: 不会修改发出的元素,而只是传递它们并且对实际订阅没有影响。

然而

map:在发送到实际订阅之前转换序列的每个值

检查此以供参考: https ://medium.com/ios-os-x-development/learn-and-master-️-the-basics-of-rxswift-in-10-minutes-818ea6e0a05b


推荐阅读