Added extensions 'emitAfter()' to main RxJava types
This commit is contained in:
parent
fa759e60cc
commit
4597623cbf
|
|
@ -0,0 +1,8 @@
|
|||
package ru.touchin.extensions.rx
|
||||
|
||||
import io.reactivex.Completable
|
||||
import io.reactivex.Flowable
|
||||
|
||||
fun <T> Flowable<T>.emitAfter(other: Completable): Flowable<T> = this.flatMap { value ->
|
||||
other.andThen(Flowable.just(value))
|
||||
}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
package ru.touchin.extensions.rx
|
||||
|
||||
import io.reactivex.Completable
|
||||
import io.reactivex.Maybe
|
||||
|
||||
fun <T> Maybe<T>.emitAfter(other: Completable): Maybe<T> = this.flatMap { value ->
|
||||
other.andThen(Maybe.just(value))
|
||||
}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
package ru.touchin.extensions.rx
|
||||
|
||||
import io.reactivex.Completable
|
||||
import io.reactivex.Observable
|
||||
|
||||
fun <T> Observable<T>.emitAfter(other: Completable): Observable<T> = this.flatMap { value ->
|
||||
other.andThen(Observable.just(value))
|
||||
}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
package ru.touchin.extensions.rx
|
||||
|
||||
import io.reactivex.Completable
|
||||
import io.reactivex.Single
|
||||
|
||||
fun <T> Single<T>.emitAfter(other: Completable): Single<T> = this.flatMap { value ->
|
||||
other.andThen(Single.just(value))
|
||||
}
|
||||
Loading…
Reference in New Issue