RX Java – chain can be completed to observable stream
                                        
                    •
                    Java                                    
                Suppose you want to insert a complete in the observable chain. For example, for each issued element, there is a runnable block and blocked before it is completed. Which option would you choose? (complete. Complete () here is an example)
> . flatMap {Completable.complete().andThen(Observable.just(it))} > . Doonnext {complete. Complete(). Blockingawait()} > what else?
Solution
.flatMapCompletable { Completable.complete().andThen(Observable.just(it)) } // If you don't want it to return
.flatMapCompletable { Completable.complete().andThen(Observable.just(it)) } // If you don't want it to return
.flatMap { Completable.complete().andThen(Observable.just(it)) } //Can be used if you want it to return Observable
                
                            The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
                        
                                            
                        THE END
                    
                    
                    
                                                        二维码
                        
                        
                                                
                        