Skip to content

Commit

Permalink
Use TinyEmitter instead of Emitter, and rename to add Emitter suffix,…
Browse files Browse the repository at this point in the history
… see #975
  • Loading branch information
samreid committed May 17, 2019
1 parent c1eb4c4 commit de96e36
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions js/display/Fittability.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
define( function( require ) {
'use strict';

var Emitter = require( 'AXON/Emitter' );
var inherit = require( 'PHET_CORE/inherit' );
var scenery = require( 'SCENERY/scenery' );
var TinyEmitter = require( 'AXON/TinyEmitter' );

/**
* @constructor
Expand Down Expand Up @@ -60,9 +60,9 @@ define( function( require ) {
// updating our bounds.
this.subtreeUnfittableCount = this.selfFittable ? 0 : 1;

// @public {Emitter} - Called with no arguments when the subtree fittability changes (whether
// @public {TinyEmitter} - Called with no arguments when the subtree fittability changes (whether
// subtreeUnfittableCount is greater than zero or not).
this.subtreeFittabilityChange = this.subtreeFittabilityChange || new Emitter();
this.subtreeFittabilityChangeEmitter = this.subtreeFittabilityChangeEmitter || new TinyEmitter();

return this; // allow chaining
},
Expand Down Expand Up @@ -183,7 +183,7 @@ define( function( require ) {
this.parent && this.parent.incrementSubtreeUnfittableCount();

// Notify anything listening that the condition ( this.subtreeUnfittableCount > 0 ) changed.
this.subtreeFittabilityChange.emit();
this.subtreeFittabilityChangeEmitter.emit();
}
},

Expand All @@ -200,7 +200,7 @@ define( function( require ) {
this.parent && this.parent.decrementSubtreeUnfittableCount();

// Notify anything listening that the condition ( this.subtreeUnfittableCount > 0 ) changed.
this.subtreeFittabilityChange.emit();
this.subtreeFittabilityChangeEmitter.emit();
}
},

Expand Down
4 changes: 2 additions & 2 deletions js/display/FittedBlock.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,13 +191,13 @@ define( function( require ) {

if ( instance ) {
this.commonFitInstance = instance;
this.commonFitInstance.fittability.subtreeFittabilityChange.addListener( this.dirtyFitListener );
this.commonFitInstance.fittability.subtreeFittabilityChangeEmitter.addListener( this.dirtyFitListener );
}
},

removeCommonFitInstance: function() {
if ( this.commonFitInstance ) {
this.commonFitInstance.fittability.subtreeFittabilityChange.removeListener( this.dirtyFitListener );
this.commonFitInstance.fittability.subtreeFittabilityChangeEmitter.removeListener( this.dirtyFitListener );
this.commonFitInstance = null;
}
},
Expand Down

0 comments on commit de96e36

Please sign in to comment.