We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dc939ce commit 278cfbbCopy full SHA for 278cfbb
firebase-database/src/androidMain/kotlin/dev/gitlive/firebase/database/database.kt
@@ -26,14 +26,12 @@ import kotlin.time.Duration.Companion.seconds
26
suspend fun <T> Task<T>.awaitWhileOnline(): T =
27
merge(
28
flow { emit(await()) },
29
- flow<T> {
30
- Firebase.database
31
- .reference(".info/connected")
32
- .valueEvents
33
- .debounce(2.seconds)
34
- .first { !it.value<Boolean>() }
35
- throw DatabaseException("Database not connected", null)
36
- }
+ Firebase.database
+ .reference(".info/connected")
+ .valueEvents
+ .debounce(2.seconds)
+ .filter { !it.value<Boolean>() }
+ .map<DataSnapshot, T> { throw DatabaseException("Database not connected", null) }
37
)
38
.first()
39
0 commit comments