GithubHelp home page GithubHelp logo

Comments (3)

hoxbro avatar hoxbro commented on June 12, 2024

It makes some sense that it runs once to know the function's output is a string.

from param.

maximlt avatar maximlt commented on June 12, 2024

I think that has to do with .rx.pipe(func) because titlex = namex.title() doesn't seem to call .title() (had to subclass str as you can't patch str.title apparently!):
image

So it seems that it has to do with .rx.pipe(). I'd like to know if this is intended and if so what other operations cause the reactive expressions to be eagerly executed. What looks pretty obvious though is that it shouldn't be called twice 🙃

from param.

philippjfr avatar philippjfr commented on June 12, 2024

By default evaluation is only semi-lazy, i.e. in most cases where you're performing chained expressions it eagerly evaluates the previous step when applying a new operation. This is the only way to provide sensible and early feedback to the user that the expression they're building is valid. There could a completely lazy mode that does not evaluate (and therefore validate) any of the expression until the output is requested.

That said as you point out, there should only be a single evaluation in your example above.

from param.

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.