Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import scala.concurrent.{ExecutionContext, Future}
- object MyImplicits {
- implicit def optionalFutureToFuture[A](obj: Option[Future[A]])(implicit ec: ExecutionContext): Future[Option[A]] = {
- obj match {
- case Some(t) => t.map(Some(_))
- case None => Future.successful(None)
- }
- }
- }
Add Comment
Please, Sign In to add comment