Closed zepumph closed 1 year ago
A brief investigation seems helpful and nice.
In LabModel we are depending on a listener order to make sure the tenFrames are disposed before the tenFrame view:
Plus an assertion here in the view that will dispose from the same list: https://github.com/phetsims/number-suite-common/blob/78a13c1708d1296aa91e462bb1cdaaba705ef723/js/lab/view/LabScreenView.ts#L210
It seems worse to manually dispose each time we change the array (right now just in one place + on reset/clear). I am inclined to approve of this MVC listener order dependency.
@samreid and I talked and I realized from it that MVC is much better if the view listens to the disposal of the tenFrame model instead of the removal from the list (which is what the model disposal listens to).
Dependency removed, closing
From https://github.com/phetsims/axon/issues/215