These are chat archives for ThoughtWorksInc/Binding.scala

17th
Nov 2018
Leonid Turnaev
@glmars
Nov 17 2018 03:47
Why are you thinking it isn't possible? I suppose, you can try and if you will have a concrete problem, you can write stackoverflow question. As I know there is a link in Readme to an example project of the using Google maps with Binding.scala which can be helpful for you.
Mustafa Kuscu
@mcku
Nov 17 2018 14:55
Well, i like using leaflet, my other project is using leaflet. The binding.scala + google maps tutorial has binding.scala components for the search box related data binding only. The map is bound to the dom by the leaflet.js itself. Therefore it is outside of the managed code, the leaflet code updates the dom directly. Therefore the problem becomes how to integrate these together. This is a similar problem in the react world, too. In the react world i was using react-leaflet for managing the lifecycle of the map's sub components (https://react-leaflet.js.org/docs/en/intro.html#lifecycle-process). But here i don't know if it is possible to extend or customize the life cycle of dom components, the map in particular, and relate them to those of the binding.scala components. It may be just easier to re-implement leaflet.js in binding.scala, because leaflet.js includes lots of custom event handling stuff which is simply redundant in the existing of binding.scala.
Mustafa Kuscu
@mcku
Nov 17 2018 15:14

For instance, when a map is initialized by leaflet, the container that is associated with the map is 'marked', therefore after a re-rendering caused by .bind, the map may become unusable because it won't contain leaflet.js-originated stuff... This one can be avoided by careful coding.

But one other thing is to use a dom annotated component's value within the non-binding-aware, external library. This one i still don't know. extfunc(x.bind) would this be recalculated after x changes?

Mustafa Kuscu
@mcku
Nov 17 2018 22:25

i realize that i might have been missing a basic feature until now. :/ i don't know how others use watch but watch does this. If i put the external func in Binding{} and add watch, it works. Binding{extfunc(x.bind)}.watch()

let me go and break my head.. (:|)