Skip to content

Commit

Permalink
remove emit1(), use emit() instead, phetsims/axon#211
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph authored and chrisklus committed Jun 2, 2021
1 parent 59a0876 commit 21b7ca0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions js/make-a-ten/common/model/PaperNumber.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ define( function( require ) {
this.baseNumbers = PaperNumber.getBaseNumbers( this.numberValueProperty.value );

// @public {Emitter} - Fires when the user stops dragging a paper number.
this.endDragEmitter = new Emitter();
this.endDragEmitter = new Emitter( { validationEnabled: false } );

// @public {Emitter} - Fires when the animation towards our destination ends (we hit our destination).
this.endAnimationEmitter = new Emitter();
this.endAnimationEmitter = new Emitter( { validationEnabled: false } );
}

makeATen.register( 'PaperNumber', PaperNumber );
Expand Down Expand Up @@ -92,7 +92,7 @@ define( function( require ) {
// Less than one time step away, so just go to the destination.
this.positionProperty.value = this.destination;
this.animating = false;
this.endAnimationEmitter.emit1( this );
this.endAnimationEmitter.emit( this );
}
}
},
Expand Down
18 changes: 9 additions & 9 deletions js/make-a-ten/common/view/PaperNumberNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ define( function( require ) {
this.paperNumber = paperNumber;

// @public {Emitter} - Triggered with self when this paper number node starts to get dragged
this.moveEmitter = new Emitter();
this.moveEmitter = new Emitter( { validationEnabled: false } );

// @public {Emitter} - Triggered with self when this paper number node is split
this.splitEmitter = new Emitter();
this.splitEmitter = new Emitter( { validationEnabled: false } );

// @public {Emitter} - Triggered when user interaction with this paper number begins.
this.interactionStartedEmitter = new Emitter();
this.interactionStartedEmitter = new Emitter( { validationEnabled: false } );

// @private {boolean} - When true, don't emit from the moveEmitter (synthetic drag)
this.preventMoveEmit = false;
Expand Down Expand Up @@ -76,9 +76,9 @@ define( function( require ) {
this.moveDragHandler = new DragListener( {
targetNode: this,
start: function( event, listener ) {
self.interactionStartedEmitter.emit1( self );
self.interactionStartedEmitter.emit( self );
if ( !self.preventMoveEmit ) {
self.moveEmitter.emit1( self );
self.moveEmitter.emit( self );
}
},

Expand All @@ -88,7 +88,7 @@ define( function( require ) {

end: function( event, listener ) {
tryToCombineNumbers( self.paperNumber );
paperNumber.endDragEmitter.emit1( paperNumber );
paperNumber.endDragEmitter.emit( paperNumber );
}
} );
this.moveDragHandler.isUserControlledProperty.link( function( controlled ) {
Expand Down Expand Up @@ -116,8 +116,8 @@ define( function( require ) {

paperNumber.changeNumber( amountRemaining );

self.interactionStartedEmitter.emit1( self );
self.splitEmitter.emit1( self );
self.interactionStartedEmitter.emit( self );
self.splitEmitter.emit( self );

var newPaperNumber = new PaperNumber( amountToRemove, paperNumber.positionProperty.value );
addAndDragNumber( event, newPaperNumber );
Expand Down Expand Up @@ -178,7 +178,7 @@ define( function( require ) {
}

// Changing the number must have happened from an interaction. If combined, we want to put cues on this.
this.interactionStartedEmitter.emit1( this );
this.interactionStartedEmitter.emit( this );
},

/**
Expand Down

0 comments on commit 21b7ca0

Please sign in to comment.