Can scalatags be used together with binding.scala?

萝らか妹 提交于 2020-01-13 11:03:13

问题


Binding.scala's examples contain Scala XML tags as a language to code DOM fragments. Can scalatags be used instead?


回答1:


Binding.scala internally generates very sophisticated ScalaTags code. On the other hand, manually written naive ScalaTags code recreates entire DOM whenever the data changes.

Milad Khajavi created an example demonstrating the problem of the manually written ScalaTags code: https://gitter.im/ThoughtWorksInc/Binding.scala?at=581b6367eed0c3125f30d57b

ScalaTags is very convenient for simple application. However, since they are plain function calls that do not have any ability to partially update, ScalaTags is not a good choice for a complex interactive application if you need fine-grained update on DOM.



来源:https://stackoverflow.com/questions/42893721/can-scalatags-be-used-together-with-binding-scala

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!