I have a Binding[Seq[T]].
I want to create a BindingSeq[T] in a way that, whenever I change the Seq the BindingSeq will change in the same way.
How can I do this?
I have a Binding[Seq[T]].
I want to create a BindingSeq[T] in a way that, whenever I change the Seq the BindingSeq will change in the same way.
How can I do this?
You can convert a Binding[Seq[T]]
to a BindingSeq[T]
.
def convert1[T](bindingOfSeq: Binding[Seq[T]]): BindingSeq[T] = {
Constants(bindingOfSeq).flatMap { bindingOfSeq =>
Constants(bindingOfSeq.bind: _*)
}
}
or
def convert2[T](bindingOfSeq: Binding[Seq[T]]): BindingSeq[T] = {
SingletonBindingSeq(bindingOfSeq).flatMap { seq =>
Constants(seq: _*)
}
}
However, the Seq
, if it is a mutable Seq, has no magic data-binding ability.
When you change the content of the Seq
, nothing happens.