tenderowls / moorka

ABANDONED
21 stars 5 forks source link

getOrElse for Rx[Try[T]] #42

Closed vsuharnikov closed 9 years ago

vsuharnikov commented 9 years ago

With this function we can write the nicer code. For example:

val future: Future[Int] = Future { 1 }
val rx = future.toRx getOrElse 0
// vs:
val rx = future.toRx.map {
  case Success(n) => n
  case _ => 0
}