Code Monkey home page Code Monkey logo

Comments (4)

rwjblue avatar rwjblue commented on May 22, 2024

@computed('attr.model.@each.{something,somethingElse}') should pass the value of attr.model in to the callback function.

We should just pass in the portion prior to the .@each or .[].

from ember-decorators.

stefanpenner avatar stefanpenner commented on May 22, 2024

We should just pass in the portion prior to the .@each or .[].

my thoughts exactly +1

from ember-decorators.

stevesims avatar stevesims commented on May 22, 2024

I ran into this behaviour just yesterday, and frankly I was rather surprised to discover that I wasn't getting the value passed through to my computed function that I had specified as my dependent key. The behaviour exhibited was non-obvious to me and unexpected.

Yes, I do realise that the behaviour from this issue is as has been documented, but I had skipped past that part of the documentation before.

My presumption was that by specifying it as the key I'd get passed [email protected], i.e. an array of those foo values. The first statement of my CP function ended up being a get for that key, and I ignored the something being passed into my function.

Had I wanted to work with something, but make sure that the CP is affected by the foo values changing then intuitively I'd have written my declaration to be @computed('something', '[email protected]') bar(something) {.

from ember-decorators.

pzuraq avatar pzuraq commented on May 22, 2024

I think this is now more of a concern with kellyselden/ember-macro-helpers, as this lib now just wraps that one as a decorator

from ember-decorators.

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.