These are chat archives for ThoughtWorksInc/Binding.scala

Jan 2018
Mustafa Kuscu
Jan 16 2018 12:39
Hi @Atry, i have started using your library. I think some helpers like this may be useful for beginners. I am kind of observing that dealing with futures and bindings add up extra lines of code..
 // some helpers for binding.scala
  @dom def futureBindingToBinding[T](futureBinding: Binding[Option[Try[T]]], emptyVal: T): Binding[T] = futureBinding.bind
    .map((y:Try[T]) => y.get)

  @dom def futureBindingToBindingSeq[T](futureBindingSeq: Binding[Option[Try[Seq[T]]]], emptyVal: Seq[T]): Binding[BindingSeq[T]] = {
    val tmpSeq: Seq[T] = futureBindingSeq.bind
      .map((y: Try[Seq[T]]) => y.get)
    val x: BindingSeq[T] = Vars(tmpSeq: _*)
杨博 (Yang Bo)
Jan 16 2018 14:19
You can create your own library of these helpers. People will use your library as long as they feel useful.