I have this:
case class Sides[A](east: A, west: A)
I want to convert this Sides[Future[Boolean]]
into this Future[Sides[Boolean]]
using Future.sequence
how?
This is the docs:
def
sequence[A, M[X] <: TraversableOnce[X]](in: M[Future[A]])(implicit cbf: CanBuildFrom[M[Future[A]], A, M[A]], executor: ExecutionContext): Future[M[A]]
Permalink
Simple version of Future.traverse. Transforms a TraversableOnce[Future[A]] into a Future[TraversableOnce[A]]. Useful for reducing many Futures into a single Future