phetsims / color-vision

"Color Vision" is an educational simulation in HTML5, by PhET Interactive Simulations.
http://phet.colorado.edu/en/simulation/color-vision
GNU General Public License v3.0
1 stars 7 forks source link

use Property.multilink #52

Closed pixelzoom closed 10 years ago

pixelzoom commented 10 years ago

When you need to listen to multiple properties, don't create a DerivedProperty that doesn't derive anything. Instead, use PropertySet.multilink (if all properties are part of the same set) or Property.multilink.

Here's an example in SolidBeamNode:

85 model.toDerivedProperty( [ 'flashlightWavelength', 'filterWavelength', 'light', 'filterVisible', 'beam' ],

pixelzoom commented 10 years ago

Looks like the above may be the only candidate for this change.

aaronsamuel137 commented 10 years ago

Multilink seems more appropriate here. Thanks for pointing this out.

aaronsamuel137 commented 10 years ago

Closing.