Skip to content

Overly verbose alternative examples in README? #4

Description

@gabrielgrant

Am I missing something, or could the alternative examples be simplified using Ember.computed.filterBy to just be:

// app/controllers/posts.js

export default Ember.Controller.extend({

  posts: Ember.computed(function() {
    return this.store.peekAll('post');
  }),

  filteredPosts: Ember.computed.filterBy('posts', 'isPublished')
});

and

// app/models/post.js

export default DS.Model.extend({

  comments: DS.hasMany('comment'),

  maintainedComments: Ember.computed.filterBy('comments', 'isDeleted', false);
  })
});

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions