codelab-kotlin-coroutines icon indicating copy to clipboard operation
codelab-kotlin-coroutines copied to clipboard

Code missing on Page 11 of advanced-coroutines-codelab

Open TTransmit opened this issue 5 years ago • 2 comments

One page 11 of the Advanced Coroutines with Kotlin Flow and LiveData codelab, it says to add the following code to replace customSortFlow to demonstrate how the combine operator works on flows:

// Create a flow that calls a single function
private val customSortFlow = suspend {() }.asFlow()
   .onStart {
       emit(listOf())
       delay(1500)
   }

The code doesn't compile. I think this was the intended code.

// Create a flow that calls a single function
private val customSortFlow = suspend { plantsListSortOrderCache.getOrAwait() }.asFlow()
   .onStart {
       emit(listOf())
       delay(1500)
   }

TTransmit avatar Jan 20 '20 16:01 TTransmit

Thanks, this codelab is quite shoddy

bupont avatar Jul 07 '20 14:07 bupont

Thank you for providing the correction for this. It's now March 2022, and although the codelab is listed as having been updated on January 13, 2022, the issue (and a few others) persist.

mikaere66 avatar Mar 13 '22 23:03 mikaere66