phetsims / scenery-phet

Reusable components based on Scenery that are specific to PhET simulations.
http://scenerystack.org/
MIT License
9 stars 6 forks source link

getValueProperty doesn't have to be a Property #842

Closed marlitas closed 9 months ago

marlitas commented 9 months ago

After talking with @zepumph about using GroupSortInteraction for the LevelingOut screen in Mean Share and Balance, we determined that getValueProperty should just become getValue. This helps with a use case in Leveling Out where the items being sorted are not attached to a NumberProperty, but are instead attached to a Property of type Plate.

@zepumph said he can do this refactor and it should be relatively straightforward since we weren't really using getValueProperty as a Property in the first place.

zepumph commented 9 months ago

related to https://github.com/phetsims/mean-share-and-balance/issues/137 and #841.

zepumph commented 9 months ago

We decided to rename to getGroupItemValue()

zepumph commented 9 months ago

Alright. It has been done.

The worst part about it was that we now need sortGroupItem to be required, since there isn't way to change a value without a Property. No big deal if you ask me!!

Please review and feel free to close.

marlitas commented 9 months ago

Looks really great. Thanks @zepumph! Closing.