Skip to content

Commit

Permalink
Added REVIEW comments regarding listeners and emitters #29
Browse files Browse the repository at this point in the history
  • Loading branch information
Denz1994 committed Dec 21, 2018
1 parent 2117249 commit 7fd0f47
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions js/game/view/BuildingGameScreenView.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ define( require => {
transition = this.mainTransitionNode.slideRightTo( this.levelSelectionLayer, QUADRATIC_TRANSITION_OPTIONS );
}
if ( oldChallengeNode ) {
// REVIEW: Do we not have to remove emitters from transitionNodes?
transition.endedEmitter.addListener( () => {
oldChallengeNode.wrapper.dispose();
oldChallengeNode.dispose();
Expand All @@ -218,6 +219,7 @@ define( require => {

const gameAudioPlayer = new GameAudioPlayer( model.soundEnabledProperty );

// REVIEW: Should a dispose call remove these listeners?
model.allLevelsCompleteEmitter.addListener( () => gameAudioPlayer.gameOverPerfectScore() );
model.singleLevelCompleteEmitter.addListener( () => gameAudioPlayer.challengeComplete() );
model.collectedGroupEmitter.addListener( () => gameAudioPlayer.correctAnswer() );
Expand Down
1 change: 1 addition & 0 deletions js/intro/view/numberline/NumberLineNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ define( require => {
* @override
*/
dispose() {
// REVIEW: Would it be safer to dispose this.containerCountProperty?
this.containerCountProperty.unlink( this.containerCountListener );
this.minorTickMultilink.dispose();
this.multipliedTickMultilink.dispose();
Expand Down

0 comments on commit 7fd0f47

Please sign in to comment.