Skip to content

Commit d8745b4

Browse files
collect (#786)
* commit * commit * Update Co-authored-by: Brandon Ward <[email protected]> * Update Co-authored-by: Brandon Ward <[email protected]> --------- Co-authored-by: Brandon Ward <[email protected]>
1 parent 94bc7b5 commit d8745b4

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package com.baeldung.comparecollectandcollectlatest
2+
3+
import kotlinx.coroutines.flow.flowOf
4+
import kotlinx.coroutines.runBlocking
5+
6+
fun main() {
7+
runBlocking {
8+
flowOf(1, 2, 3).collect { value ->
9+
println(value)
10+
}
11+
}
12+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package com.baeldung.comparecollectandcollectlatest
2+
3+
import kotlinx.coroutines.flow.collectLatest
4+
import kotlinx.coroutines.flow.flowOf
5+
import kotlinx.coroutines.runBlocking
6+
7+
fun main() {
8+
runBlocking {
9+
flowOf(1, 2, 3).collectLatest { value ->
10+
println(value)
11+
}
12+
}
13+
}
14+

0 commit comments

Comments
 (0)