Kotlin's Coroutine Extension Functions

Kotlin's Coroutine Extension Functions

Kotlin's Coroutine extension functions to switch from one context to another one. Supports [Dispatchers.IO], [Dispatchers.Main], [Dispatchers.Default

ยท

1 min read

If get to know something new by reading my articles, don't forget to endorse me on LinkedIn

Usages:

scope.toMain{ /*this: CoroutineScope */
// Write your code here
}

scope.toIO{ /*this: CoroutineScope */
// Write your code here
}

scope.toDefault{ /*this: CoroutineScope */
// Write your code here
}

scope.toUnconfined{ /*this: CoroutineScope */
// Write your code here
}

Follow Me on LinkedIn

ย