Skip to content

Commit

Permalink
Implement Disposable base type, phetsims/scenery#1494
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Nov 10, 2022
1 parent 5883df8 commit cfcba56
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions js/john-travoltage/model/Electron.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,6 @@ class Electron extends PhetioObject {
this.maxSpeed = 500;
this.maxForceSquared = 100000000;

// @public (read-only) called when the Electron is disposed so listeners may clean themselves up
this.disposeEmitter = new Emitter();

// @public (phet-io) the history of body positions, 'arm', 'leg' and 'body' for rendering in the correct place
this.history = [];

Expand All @@ -77,7 +74,6 @@ class Electron extends PhetioObject {
}

this.disposeElectron = () => {
this.disposeEmitter.emit();
this.positionProperty.dispose();
};
}
Expand All @@ -90,7 +86,7 @@ class Electron extends PhetioObject {
* @param {number} dt - in seconds
*/
stepInSpark( dt ) {
//move to closest line segment
//move to the closest line segment
if ( !this.segment ) {

this.segment = _.minBy( this.model.forceLines, forceLine => forceLine.p0.distanceSquared( this.positionProperty.get() ) );
Expand Down

0 comments on commit cfcba56

Please sign in to comment.