mirror of
https://github.com/quik-sms/quik.git
synced 2026-11-17 19:38:52 +01:00
Add empty state to inbox and archived
This commit is contained in:
@@ -21,8 +21,11 @@ package common.util.extensions
|
||||
|
||||
import common.util.Optional
|
||||
import io.reactivex.Flowable
|
||||
import io.reactivex.Observable
|
||||
|
||||
fun <T, R> Flowable<T>.mapNotNull(mapper: (T) -> R?): Flowable<R>
|
||||
= map { input -> Optional(mapper(input)) }
|
||||
.filter { optional -> optional.notNull() }
|
||||
.map { optional -> optional.value }
|
||||
.map { optional -> optional.value }
|
||||
|
||||
fun <T> Observable<T>.toFlowable(): Flowable<T> = this.toFlowable(io.reactivex.BackpressureStrategy.BUFFER)
|
||||
Reference in New Issue
Block a user