Only functions that are using blocking methods should be wrapped into withContext, so your example is correct, because neither Repository nor Remote are invoking a blocking function, because we follow a convention that suspending functions do not block and Api already took care to follow this convention.

Written by

Project Lead for the Kotlin Programming Language @JetBrains

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