phetsims / build-a-molecule

"Build a Molecule" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
8 stars 7 forks source link

Document why removal must be guarded, or remove the guard #218

Closed samreid closed 3 years ago

samreid commented 3 years ago

In https://github.com/phetsims/axon/issues/332 we removed the guard from createObservableArray removal methods. I added a sim-specific guard in the following commit, but I'm not sure if it should be documented or eliminated. Assigning to responsible dev to take a look:

https://github.com/phetsims/build-a-molecule/commit/a2cb0776b6b7914cfdb6033e027338a084167005

Denz1994 commented 3 years ago

Guard has been removed. It isn't necessary if we remove the atom from the particle list in the atomDragCallback instead of in the particleRemovedListener. Thanks for shedding some light on this issue. Closing.