Skip to content

Commit fd56ab6

Browse files
committed
update(add): take(1) first change intent
1 parent 20ba922 commit fd56ab6

File tree

1 file changed

+4
-0
lines changed
  • feature-add/src/main/java/com/hoc/flowmvi/ui/add

1 file changed

+4
-0
lines changed

feature-add/src/main/java/com/hoc/flowmvi/ui/add/AddVM.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import kotlinx.coroutines.flow.onEach
3030
import kotlinx.coroutines.flow.onStart
3131
import kotlinx.coroutines.flow.scan
3232
import kotlinx.coroutines.flow.stateIn
33+
import kotlinx.coroutines.flow.take
3334
import timber.log.Timber
3435

3536
@ExperimentalCoroutinesApi
@@ -139,12 +140,15 @@ class AddVM(
139140
val firstChanges = merge(
140141
filterIsInstance<ViewIntent.EmailChangedFirstTime>()
141142
.log("Intent")
143+
.take(1)
142144
.mapTo(PartialStateChange.FirstChange.EmailChangedFirstTime),
143145
filterIsInstance<ViewIntent.FirstNameChangedFirstTime>()
144146
.log("Intent")
147+
.take(1)
145148
.mapTo(PartialStateChange.FirstChange.FirstNameChangedFirstTime),
146149
filterIsInstance<ViewIntent.LastNameChangedFirstTime>()
147150
.log("Intent")
151+
.take(1)
148152
.mapTo(PartialStateChange.FirstChange.LastNameChangedFirstTime)
149153
)
150154

0 commit comments

Comments
 (0)