RxJava 2, what happen the resultSelector argument of flatmap?

感情迁移 提交于 2019-12-04 19:46:04

I don't think Single ever supported this operator and the Observable/Flowable operators are still there. You can accomplish this behavior by mapping the result of the inner source:

source.flatMap(originalValue -> 
    createInnerSource(originalValue)
    .map(innerValue -> process(originalValue, innerValue))
)

The lambda of the map will capture the originalValue for you.

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