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()
}
}
}
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()
}
}
}