Resuming with a Value

Learn how to resume a suspended coroutine with a value.

We'll cover the following

One thing that might concern us is why we passed Unit to the resume function. We might also be wondering why we used Unit as a type argument for the suspendCoroutine. The fact that these two are the same is no coincidence. The Unit parameter is also returned from the function and is the generic type of the Continuation parameter.

Get hands-on with 1200+ tech skills courses.