Skip to content

Instantly share code, notes, and snippets.

@tiwiz
Created November 27, 2017 13:09
Show Gist options
  • Save tiwiz/73ac3022598240847aee3b1fe6b25767 to your computer and use it in GitHub Desktop.
Save tiwiz/73ac3022598240847aee3b1fe6b25767 to your computer and use it in GitHub Desktop.
fun View.onClickAsync(action: suspend () -> Deferred<OurType>) {
setOnClickListener {
  launch(UI) {
  val response = action().await()
  bindUiTo(response)
  }
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment