Giter Site home page Giter Site logo

Comments (7)

Atry avatar Atry commented on May 13, 2024

There should be a re-calculation of cacheData between line 888 and line 889

from binding.scala.

Atry avatar Atry commented on May 13, 2024

Another example written by @kahliburke : https://scalafiddle.io/sf/HX9dhMN/3

from binding.scala.

Atry avatar Atry commented on May 13, 2024

Since the cacheData should be re-calculated when watching, maybe it should be cleared when unwatching, in case of memory leaks.
https://github.com/ThoughtWorksInc/Binding.scala/blob/9513541/Binding/src/main/scala/com/thoughtworks/binding/Binding.scala#L878-L879

from binding.scala.

Atry avatar Atry commented on May 13, 2024

Also we can remove the initialization of cacheData as long as it will be computed when watching.

https://github.com/ThoughtWorksInc/Binding.scala/blob/9513541/Binding/src/main/scala/com/thoughtworks/binding/Binding.scala#L820-L824

from binding.scala.

kahliburke avatar kahliburke commented on May 13, 2024

I have tried some of the recommended changes which have not resolved the issue so far. While debugging it seemed that the use of a conditional was part of the issue, i.e.

@dom val elemDisplay = {
    if (show.bind)
      <div>{elems.bind}</div>
    else <!-- Nothing -->
  }

will show the issue while

@dom val elemDisplay = {
    val e = elems.bind
    if (show.bind)
      <div>{e}</div>
    else <!-- Nothing -->
  }

seems to work properly, with no other changes.

One thing I did notice that seems like a bug is that in FlatMapBinding.removePatchedListener there is a mistaken call for adding the patched listener to the children instead of removing it.

child.addPatchedListener(childListener)

from binding.scala.

Atry avatar Atry commented on May 13, 2024

from binding.scala.

kahliburke avatar kahliburke commented on May 13, 2024

There already is one. :)

from binding.scala.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.