You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Discovered while working on secondLocaleProperty: LocaleProperty in phetsims/number-pairs#22 ...
In localeProperty.ts, LocaleProperty is exported so that clients can create other instances. But unlike other Property subclasses, LocaleProperty does not set its phetioValueType or valueType, and leaves that to clients. So I'm getting this error in Number Pairs:
Assertion failed: PhET-iO Properties must specify a phetioValueType: numberPairs.global.model.preferences.secondLocaleProperty
The singleton localeProperty is instantiated like this:
constlocaleProperty=newLocaleProperty(phet.chipper.locale,{tandem: Tandem.GENERAL_MODEL.createTandem('localeProperty'),valueType: 'string',phetioFeatured: true,phetioValueType: StringIO,phetioDocumentation: 'Specifies language currently displayed in the simulation'});
So this should be a matter of moving valueType: 'string' and phetioValueType: StringIO to a LocaleProperty constructor (it currently has a default a constructor) and defining LocalePropertyOptions.
Discussed with @zepumph in Slack#developer, and the above sounds correct and desirable, so I'll go for it.
The text was updated successfully, but these errors were encountered:
... So this should be a matter of moving valueType: 'string' and phetioValueType: StringIO to a LocaleProperty constructor (it currently has a default a constructor) and defining LocalePropertyOptions.
Discovered while working on
secondLocaleProperty: LocaleProperty
in phetsims/number-pairs#22 ...In localeProperty.ts, LocaleProperty is exported so that clients can create other instances. But unlike other Property subclasses, LocaleProperty does not set its
phetioValueType
orvalueType
, and leaves that to clients. So I'm getting this error in Number Pairs:The singleton
localeProperty
is instantiated like this:So this should be a matter of moving
valueType: 'string'
andphetioValueType: StringIO
to a LocaleProperty constructor (it currently has a default a constructor) and definingLocalePropertyOptions
.Discussed with @zepumph in Slack#developer, and the above sounds correct and desirable, so I'll go for it.
The text was updated successfully, but these errors were encountered: