Swap callback hell for sexy suspend!

Available in: English, French, Thai

Kotlin coroutines provide a concise & elegant syntax for running concurrent & async tasks. Unlike callbacks, suspend funs can be wrapped & chained.

…but my legacy component only provides a callback interface

Traditional callback code (ugly)

Ewww.

Fortunately, Kotlin coroutines provide an extension precisely for this scenario: suspendCoroutine. …

Charles Allen

Also available in Thai: https://medium.com/@VoieDevTH

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store