欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

merge

程序员文章站 2022-06-02 13:39:07
...
merge例子:

把两个接口请求是否完成压缩为一个信号再做操作

Observable.merge(viewModel.endAction.elements, viewModel.payAction.elements)
            .observeOn(MainScheduler.instance)
            .subscribe(onNext: { [weak self] model in
                if let bottomButton = self?.payMethodsView?.bottomButton {
                    bottomButton.isLoading = false
                    bottomButton.showSuccessLoading { [weak self] in
                        self?.pushEndViewController(model: model)
                    }
                } else {
                    self?.pushEndViewController(model: model)
                }
            })
            .disposed(by: disposeBag)