Created
May 21, 2019 20:36
-
-
Save JacquesSmuts/b6b45f506d001005bc8914e0925986cc 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
fun saveUsernameAndPassword(username: String, password: String) { | |
val result = StorageService.getInstance()::saveUsernameAndPassword suspendAndInvokeWith Pair(username, password) | |
handleResult(result) | |
} | |
private suspend infix fun <Input1, Input2, Output> ((Input1, Input2, (Output) -> Unit) -> Unit).suspendAndInvokeWith(pair: Pair<Input1, Input2>): Output { | |
return suspendAsync(this, pair.first, pair.second) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment