Skip to content

Instantly share code, notes, and snippets.

@thealmikey
Last active January 21, 2020 02:53
Show Gist options
  • Save thealmikey/29f950e59967cc1f2c76218b99faabbf to your computer and use it in GitHub Desktop.
Save thealmikey/29f950e59967cc1f2c76218b99faabbf to your computer and use it in GitHub Desktop.
onTransition {
val validTransition = it as? StateMachine.Transition.Valid ?: return@onTransition
when (validTransition.sideEffect) {
UseResult.ReportHappiness -> println("Hapiness message") //ourService.log("Hapiness message")
UseResult.ReportBoredness -> println("BoredNess message") //anotherService.log("BoredNess message")
UseResult.ReportSadness -> println("Bad vibes message") //ourService.log("Bad vibes message")
UseResult.ReportGoodWork -> println("Goodwork report") //anotherService.log("Goodwork report")
UseResult.ReportVibeKiller -> println("Please don't kill my vibe")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment