Guest User

Untitled

a guest
Dec 19th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. import scala.concurrent.{ExecutionContext, Future}
  2.  
  3. object MyImplicits {
  4. implicit def optionalFutureToFuture[A](obj: Option[Future[A]])(implicit ec: ExecutionContext): Future[Option[A]] = {
  5. obj match {
  6. case Some(t) => t.map(Some(_))
  7. case None => Future.successful(None)
  8. }
  9. }
  10. }
Add Comment
Please, Sign In to add comment