2

我需要我将在链中调用一个可完成的方法,完成后,它需要使用Map运算符继续执行链
示例

Single.just(someOperation())
     .flatMapCompletable{
         completableMethod()
    }
     .map{ // i need to continue here with map or some other operator
         doSomeOperation()
    }

谁能帮我解决这个问题?

4

1 回答 1

4

Completable不提交任何数据。因此,您不能调用map. 如果您想在此使用后执行任何操作andThen

Single.just(someOperation())
     .flatMapCompletable{
         completableMethod()
    }
     .andThen{ 
         doSomeOperation()
    }

更多关于andThen

于 2019-07-21T11:54:05.797 回答