Skip to content
This repository was archived by the owner on May 26, 2019. It is now read-only.
This repository was archived by the owner on May 26, 2019. It is now read-only.

Encourage decorator-style Ember.computed/Ember.observer #455

Closed

Description

@michaelrkn

There seems to be general consensus that we should encourage people to use decorator-style methods instead of prototype extensions, except in the case of Array extensions. We should change all places in the guides that use .property to Ember.computed, and .observes to Ember.observer. For example, this:

var president = Ember.Object.create({
  firstName: "Barack",
  lastName: "Obama",

  fullName: function() {
    return this.get('firstName') + ' ' + this.get('lastName');
  }).property()
});

becomes:

var president = Ember.Object.create({
  firstName: "Barack",
  lastName: "Obama",

  fullName: Ember.computed(function() {
    return this.get('firstName') + ' ' + this.get('lastName');
  })
});

Activity

  1. trek commented on Jul 22, 2015

    @trek
    Member

    👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions