将 Rxjava Completable 转换为 Map

Sta*_*ack 2 android rx-java rx-java2 rx-kotlin2

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

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

谁能帮我解决这个问题吗?

Mar*_*iev 6

Completable不提交任何数据。因此你不能打电话map。如果您想在使用后执行任何操作andThen

Single.just(someOperation())
     .flatMapCompletable{
         completableMethod()
    }
     .andThen{ 
         doSomeOperation()
    }
Run Code Online (Sandbox Code Playgroud)

更多关于andThen