File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed
core/core/src/main/kotlin/ir/amirab/debugboard/core/plugin/watcher Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ val projectTargetSdk by ext(33)
19
19
20
20
allprojects {
21
21
group = " ir.amirab.debugboard"
22
- version = " 0.3.0 "
22
+ version = " 0.3.1 "
23
23
repositories {
24
24
google()
25
25
mavenCentral()
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ package ir.amirab.debugboard.core.plugin.watcher
3
3
import kotlinx.coroutines.flow.*
4
4
5
5
6
- class VariableWatcher : IVariableWatcher {
6
+ class VariableWatcher : IVariableWatcher {
7
7
override val watchables: MutableStateFlow <List <Watchable <* >>> = MutableStateFlow (emptyList<Watchable <* >>())
8
8
9
9
override fun addWatch (watchable : Watchable <* >) {
@@ -24,7 +24,11 @@ class VariableWatcher:IVariableWatcher {
24
24
val names = p.map {
25
25
it.name
26
26
}
27
- val x = combine(
27
+ // combine function does not emit when [flows] variable is empty! we manually emit an empty list instead
28
+ if (flows.isEmpty()) {
29
+ return flowOf(emptyList())
30
+ }
31
+ return combine(
28
32
flows = flows
29
33
) {
30
34
it.zip(names).map { pair: Pair <Any ?, String > ->
@@ -34,8 +38,6 @@ class VariableWatcher:IVariableWatcher {
34
38
)
35
39
}
36
40
}
37
-
38
- return x
39
41
}
40
42
41
43
You can’t perform that action at this time.
0 commit comments