Skip to content

Instantly share code, notes, and snippets.

@fluxtah
Created April 2, 2020 14:11
Show Gist options
  • Save fluxtah/d5b8332a766c18d9605cf8442562d067 to your computer and use it in GitHub Desktop.
Save fluxtah/d5b8332a766c18d9605cf8442562d067 to your computer and use it in GitHub Desktop.
class HelloPresenter(val model: HelloModel, val view: HelloView) {
fun onCreated(init: Boolean) {
// If this is the first time we loaded,
// then load the first greeting
if (init) {
model.loadGreeting()
}
}
fun onGreetingLoaded(greeting: String) {
view.updateGreetingText(greeting)
}
fun onShowNewGreetingButtonPressed() {
model.loadGreeting()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment