更新时间:2023-11-09 23:18:16
Lambda的suspend
修饰符应放在冒号后面,而不是前面.示例:
Lambda's suspend
modifier should be placed after the colon character, not in front. Example:
fun MyModel.onBG(bar: suspend () -> Unit) {
launch {
withContext(Dispatchers.IO) {
bar()
}
}
}