A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://stackoverflow.com/questions/52820789/binding-scala-get-current-value-of-a-binding below:

scala.js - Binding.scala: Get current value of a Binding

It seems it is not possible to get the current value of a Binding like we can do for a Var(using method value). I looked at the source and this method is declared as being private for Binding class, while it is public for Var or for Binding.Constant classes. Is-there any reason for making it private in the Binding case ? Do you know there is another way to achieve that for a Binding ?

Just to give a word about the context, my use-case is the following: I have a complex object within a Var and from this Var, I derive several Binding representing lists of simple objects. Then I use these Binding to render HTML tables within @dom methods. Now I would like to perform some sequential search in the data displayed in the table (without having to derive them again from the original Var object) So, basically, I would like to get the current value of the Binding used to show my table in order to perform the search.

Currently, the only option I can think of is to use Var instead of Binding for my derived objects and then to use a watched binding expression to update the derived Var when the source Var changes. But this makes the code much less concise and I have the feeling that this would add some performance overhead. Do you have some ideas to accomplish that in a better way?

Thanks in advance for any answer!


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4