codelab-kotlin-coroutines
codelab-kotlin-coroutines copied to clipboard
Code missing on Page 11 of advanced-coroutines-codelab
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)
}
Thanks, this codelab is quite shoddy
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.