Created
October 3, 2016 05:20
-
-
Save kiwiandroiddev/886a90f2c22315fcd02d521f9970ede9 to your computer and use it in GitHub Desktop.
filterNotNull for RxJava in Kotlin
This file contains hidden or 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
| /** | |
| * Asynchronous equivalent of filterNotNull in Kotlin's stdlin (kotlin.collections) | |
| */ | |
| fun <T> Observable<T?>.filterNotNull() : Observable<T> { | |
| return this.filter { item -> item != null }.map { it!! } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment