RxJava Return single, execute completable after

前端 未结 4 549
一生所求
一生所求 2021-02-13 18:58

I\'m trying to accomplish the following: Return some data as single, execute a completable after. The following code does not compile due to single.andThen(). The actions need t

4条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-13 19:42

    Note that if you don't care whether the result is Single or Completable there is a special flatMapCompletable operator in RxJava2 to execute completable after Single:

    single.flatMapCompletable(result -> completable);

提交回复
热议问题