I would like to know if this is extremely bad practice or not.
I am overriding arrangedContent and filtering the content when a user selects an item from a dropdown or types some text into an input so this function could run quite a lot:
I want to sort the results after I have filtered the results. I was thinking of doing this but thought against it:
arrangedContent: ( ->
filtered = @get('content').filter (item) ->
#filter content
Ember.ArrayProxy.createWithMixins Ember.SortableMixin,
sortProperties: ['name']
).property('model.[]', 'searchText')
I am curious to know what are the implications in terms of performance and potential memory leaks of doing something like this that could be ran every time a keystroke happens.
I used a normal sort on the content, but I am curious to know if this is really bad or not.
createstatement in a computed property is bad, because as you already said it would use a lot o unnecessary memory for new instances of the ArrayProxy. You should think of a possible arrayproxy that youreuseinstead of creating new ones...