Skip to content

Instantly share code, notes, and snippets.

@JorgeCastilloPrz
Created July 31, 2018 10:56
Show Gist options
  • Save JorgeCastilloPrz/8c04cc2a0a3c035beff66c0a940bbd3b to your computer and use it in GitHub Desktop.
Save JorgeCastilloPrz/8c04cc2a0a3c035beff66c0a940bbd3b to your computer and use it in GitHub Desktop.
MaybeRuntimeTest.kt
@JvmStatic
fun main(args: Array<String>): Unit {
val user1 = User(UserId("user1"))
val user2 = User(UserId("user2"))
val user3 = User(UserId("unknown user"))
val maybeModule = Module(MaybeK.async())
maybeModule.run {
repository.allTasksByUser(user1).fix().maybe.subscribe({ println(it) }, { println(it) })
repository.allTasksByUser(user2).fix().maybe.subscribe({ println(it) }, { println(it) })
repository.allTasksByUser(user3).fix().maybe.subscribe({ println(it) }, { println(it) })
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment