android / codelab-kotlin-coroutines

Kotlin Coroutines codelab
Apache License 2.0
552 stars 268 forks source link

Code missing on Page 11 of advanced-coroutines-codelab #59

Open TTransmit opened 4 years ago

TTransmit commented 4 years ago

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)
   }
bupont commented 4 years ago

Thanks, this codelab is quite shoddy

mikaere66 commented 2 years ago

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.