1
0
mirror of https://github.com/vector-im/element-android.git synced 2025-07-28 08:42:00 +03:00

Mavericks 2: clean after PR review

This commit is contained in:
ganfra
2021-10-11 17:31:27 +02:00
parent bde129ddce
commit a26e43e90c
11 changed files with 30 additions and 20 deletions

View File

@ -22,11 +22,10 @@ import kotlinx.coroutines.flow.onStart
import kotlinx.coroutines.withContext
internal fun <T> Flow<T>.startWith(supplier: suspend () -> T): Flow<T> {
return this
.onStart {
val value = withContext(Dispatchers.IO) {
supplier()
}
emit(value)
}
return onStart {
val value = withContext(Dispatchers.IO) {
supplier()
}
emit(value)
}
}

View File

@ -42,7 +42,7 @@ import org.matrix.android.sdk.internal.crypto.model.CryptoDeviceInfo
import org.matrix.android.sdk.internal.crypto.model.rest.DeviceInfo
import org.matrix.android.sdk.internal.crypto.store.PrivateKeysInfo
class RxFlow(private val session: Session) {
class FlowSession(private val session: Session) {
fun liveRoomSummaries(queryParams: RoomSummaryQueryParams): Flow<List<RoomSummary>> {
return session.getRoomSummariesLive(queryParams).asFlow()
@ -175,6 +175,6 @@ class RxFlow(private val session: Session) {
}
}
fun Session.flow(): RxFlow {
return RxFlow(this)
fun Session.flow(): FlowSession {
return FlowSession(this)
}