General questions should be asked on StackOverflow, not here. This room focuses on development of Binding.scala.
Atry on Atry-patch-1
Atry on master
Upgrade Scala version Merge pull request #224 from Th… (compare)
Atry on Atry-patch-1
Upgrade Scala version (compare)
Atry on master
Update sbt-scalajs, scalajs-com… Merge pull request #213 from sc… (compare)
@Atry Unfortunately I found a case where application which uses Binding.scala should depend on Scalaz. Please, see example from FAQ:
@dom def renderList(data: List[Binding[String]]) = <ol>{
import scalaz.std.list._ // Type classes for List
for (b <- data) yield {
<li>{b.bind}</li>
}
}</ol>
Can Dsl.scala remove this dependency (or change to Cats)?
for
-comprehension
@Atry If you're interested, I have repeated the js-framework-benchmark with different versions of Binding.scala.
Here are results for: Chrome 32-bit and for: Chrome 64-bit (sorry, 3 runs only).
Conclusions and questions:
let
and const
in ECMAScript 2015 code blocks has the same lifecycle as var
in IIFEs.
thanks. Another thing,: how this should be expressed correctly:
class ProcessDefsSelect(allDefs: BindingSeq[ProcessDefinition], selected: Var[Option[ProcessDefinition]]) {
@dom
def render: Binding[html.Select] = {
<select class="ui dropdown" onchange={e: Event => selected.value = allDefs.bind.find(_.id == e.target.asInstanceOf[html.Select].value)} >
{for (pDef <- allDefs) yield {
<option value={pDef.id} selected={selected.bind.exists(_.id == pDef.id)} >
{pDef.name}
</option>
}}
</select>
}
}
simple select component. This impl doesnt work due to allDefs.bind
invoked in callback function...