emberjs / guides

This repository is DEPRECATED!
https://github.com/ember-learn/guides-source
Other
283 stars 873 forks source link

Brace expansion on non-nested properties? #2291

Closed sbatson5 closed 6 years ago

sbatson5 commented 6 years ago

I was looking at the guides for computed properties and saw the section talking about brace expansion for dependent keys. The example shown is:

  fullName: computed('{firstName,lastName}', function() {
    let firstName = this.get('firstName');
    let lastName = this.get('lastName');

    return `${firstName} ${lastName}`;
  })

I had always thought it was bad practice to do brace expansion on this. I.e. person.{firstName,lastName} would be fine but {firstName,lastName} isn't. I feel like otherwise, you would never not use brace expansion. You could do things like: {someService.foo.bar,person.firstName,income,etc}

acorncom commented 6 years ago

@sbatson5 I would tend to concur. Would you mind sending in a PR and we’ll fix it?

sbatson5 commented 6 years ago

PR here: https://github.com/emberjs/guides/pull/2294 @acorncom