From 77901f769680a15113fbead6b2faef2ee0529067 Mon Sep 17 00:00:00 2001 From: Michael Kauzmann Date: Tue, 11 Jun 2024 12:54:00 -0600 Subject: [PATCH] locale query parameter mapping logic should be reusable, and localeProperty should support it with grace, https://github.com/phetsims/joist/issues/970 Signed-off-by: Michael Kauzmann --- js/ReadOnlyProperty.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/js/ReadOnlyProperty.ts b/js/ReadOnlyProperty.ts index 23376a38..5f92b36d 100644 --- a/js/ReadOnlyProperty.ts +++ b/js/ReadOnlyProperty.ts @@ -570,7 +570,8 @@ export default class ReadOnlyProperty 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. @@ -584,6 +585,10 @@ export default class ReadOnlyProperty 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( stateObject: ReadOnlyPropertyState ): void { const units = NullableIO( StringIO ).fromStateObject( stateObject.units ); assert && assert( this.units === units, 'Property units do not match' );