Skip to content

Commit

Permalink
locale query parameter mapping logic should be reusable, and localePr…
Browse files Browse the repository at this point in the history
…operty should support it with grace, phetsims/joist#970

Signed-off-by: Michael Kauzmann <[email protected]>
  • Loading branch information
zepumph committed Jun 11, 2024
1 parent 19ef567 commit 77901f7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion js/ReadOnlyProperty.ts
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,8 @@ export default class ReadOnlyProperty<T> extends PhetioObject implements TReadOn
}

/**
* Implementation of serialization for PhET-iO support.
* Implementation of serialization for PhET-iO support. Override this function to customize how this state
* behaves (but be careful!).
*
* This function is parameterized to support subtyping. That said, it is a bit useless, since we don't want to
* parameterize ReadOnlyProperty in general to the IOType's state type, so please bear with us.
Expand All @@ -584,6 +585,10 @@ export default class ReadOnlyProperty<T> extends PhetioObject implements TReadOn
};
}

/**
* Implementation of serialization for PhET-iO support. Override this function to customize how this state
* behaves (but be careful!).
*/
protected applyState<StateType>( stateObject: ReadOnlyPropertyState<StateType> ): void {
const units = NullableIO( StringIO ).fromStateObject( stateObject.units );
assert && assert( this.units === units, 'Property units do not match' );
Expand Down

0 comments on commit 77901f7

Please sign in to comment.