Last active
June 22, 2018 12:34
-
-
Save rock3r/3d63c9508b6bcd875d8f80ed84fd4ed7 to your computer and use it in GitHub Desktop.
RxKotlin's ofType() name is not very easy to remember, given Kotlin has filterIsInstance() for the same. This helps alleviate the pain.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package me.seebrock3r.extensions.reactivex | |
import io.reactivex.Flowable | |
import io.reactivex.Observable | |
import io.reactivex.rxkotlin.ofType | |
@Deprecated( | |
message = "This is just a shorthand for RxKotlin's ofType()", | |
replaceWith = ReplaceWith("ofType<R>()", "io.reactivex.rxkotlin.ofType") | |
) | |
inline fun <reified R : Any> Flowable<*>.filterIsInstance(): Flowable<R> = ofType() | |
@Deprecated( | |
message = "This is just a shorthand for RxKotlin's ofType()", | |
replaceWith = ReplaceWith("ofType<R>()", "io.reactivex.rxkotlin.ofType") | |
) | |
inline fun <reified R : Any> Observable<*>.filterIsInstance(): Observable<R> = ofType() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment