Skip to content

Commit

Permalink
Allow instrumented DerivedProperties to update during PhET-iO state s…
Browse files Browse the repository at this point in the history
…et, see #409
  • Loading branch information
samreid committed Aug 24, 2022
1 parent 2c7a899 commit c00fd24
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion js/ReadOnlyProperty.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,10 @@ export default class ReadOnlyProperty<T> extends PhetioObject implements TReadOn

// state is managed by the PhetioStateEngine
const setManagedByPhetioState = window.phet && phet?.joist?.sim?.isSettingPhetioStateProperty.value
&& this.isPhetioInstrumented() && this.phetioState;
&& this.isPhetioInstrumented() && this.phetioState

// However, DerivedProperty should be able to update during PhET-iO state set
&& this.isSettable();

if ( !setManagedByPhetioState ) {
this.unguardedSet( value );
Expand Down

0 comments on commit c00fd24

Please sign in to comment.