Solution: Suspension Coroutine with Specified Type for Output

See the solution for suspending a coroutine with the specified type of output.

We'll cover the following

Solution

When we call suspendCoroutine, we can specify which type will be returned in its continuation. The same type needs to be used when we call resume.

Get hands-on with 1200+ tech skills courses.