Open johno opened 9 years ago
Add a single property component that can be more performant:
filteredList: function() { var query = this.get('filterQuery').trim(); var strictMatch = this.get('strictMatch'); if (Ember.isBlank(query)) { return this.get('list'); } if (!strictMatch) { query = query.toLowerCase(); } return this.get('list').filter(function(object) { if (strictMatch) { if (Ember.isEqual(object.get('name'))) { return true; } } else { if (isLike(object.get('name').toLowerCase(), query)) { return true; } } }); }.property('list.@each.name', 'filterQuery')
Also, leverage Ember.computed: https://medium.com/the-ember-way/ember-simple-text-search-computed-property-macro-1b7ca6a25ad2
Ember.computed
Add a single property component that can be more performant: