Last active
May 21, 2019 20:26
-
-
Save JacquesSmuts/40462adab3f657da91d25dfdba84ef99 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
suspend fun saveUsername(username: String) { | |
val result = suspendedSaveUsername(username) | |
handleResult(result) | |
} | |
suspend fun suspendedSaveUsername(username: String) = suspendCoroutine<String> { continuation -> | |
StorageService.getInstance().saveUsername(username) { result -> | |
continuation.resume(result) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment