久久r热视频,国产午夜精品一区二区三区视频,亚洲精品自拍偷拍,欧美日韩精品二区

您的位置:首頁技術(shù)文章
文章詳情頁

android - rxjava2封裝統(tǒng)一取消注冊問題

瀏覽:117日期:2024-02-25 17:47:09

問題描述

我在rxjava1中這么寫沒有問題的,在rxjava2中我應(yīng)該怎么寫

android - rxjava2封裝統(tǒng)一取消注冊問題

問題解答

回答1:

mDisposables.add(mTasksRepository.createAuthorize(rBody) .observeOn(AndroidSchedulers.mainThread()) .subscribe(loginResponse -> {Timber.i('createAuthorizeSuccess'); }, throwable -> {Timber.e('createAuthorizeError'); }));

RxJava 2 features several base classes you can discover operators on:

io.reactivex.Flowable : 0..N flows, supporting Reactive-Streams and backpressure

io.reactivex.Observable: 0..N flows, no backpressure

io.reactivex.Single: a flow of exactly 1 item or an error

io.reactivex.Completable: a flow without items but only a completion or error signal

io.reactivex.Maybe: a flow with no items, exactly one item or an error

取消訂閱可以試試 RxLifecycle https://github.com/trello/RxL...,使用起來很方便。

標(biāo)簽: java
相關(guān)文章:
主站蜘蛛池模板: 嘉黎县| 新营市| 乌兰察布市| 灌阳县| 个旧市| 定西市| 二连浩特市| 湖南省| 凌云县| 景德镇市| 凤凰县| 鸡东县| 肥乡县| 乐亭县| 灵武市| 宜兰市| 宁陵县| 安图县| 鲜城| 临沭县| 毕节市| 双辽市| 阳西县| 天津市| 南昌县| 岫岩| 临邑县| 平度市| 永州市| 峨眉山市| 顺平县| 济南市| 天台县| 古田县| 通城县| 秭归县| 石台县| 桐乡市| 红桥区| 醴陵市| 霍林郭勒市|