Quantcast
Channel: Ember.JS - Latest topics
Viewing all articles
Browse latest Browse all 4831

Is Ember.Object.willDestroy method called after recalculating a computed property?

$
0
0

@Henry wrote:

hi guys, I have the following question: when a computed property that creates Ember.Objects is recalculated, shouldn't the old Ember.Objects created call their willDestroy method? I have a twiddle here but it's not showing anything in the console.

As far as I know, when there's a change in the array, the objects created in the CP are recreated, so what happens with the old ones? I thought they would be destroyed since there isn't anything referencing them, but if that were the case, wouldn't they call the method willDestroy?

Better expressed by @grapho in Slack:

but i think the main question is if you are computed.map and generating an array of objects.. then the computed property is recalculated.. why are those original objects not destroyed? they are just ​replaced​ by new objects?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4831

Trending Articles