-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ObjectIO method parameters are incorrect #183
Labels
Comments
This will be addressed by the proposal in #211, on hold until then. |
These are centrally documented in IOType options: /**** STATE ****/
// {function(coreObject:*):*)} Serialize the core object. Most often this looks like an object literal that holds
// data about the PhetioObject instance.
toStateObject: supertype && supertype.toStateObject,
// {function(stateObject:*):*} For Data Type Deserialization. Decodes the object from a state (see toStateObject)
// into an instance.
fromStateObject: supertype && supertype.fromStateObject,
// {function(stateObject:*):Array[*]} For Dynamic Element Deserialization: converts the state object to a `create`
// function in PhetioGroup or other PhetioDynamicElementContainer creation function. Note that other non-serialized
// args (not dealt with here) may be supplied as closure variables. This function only needs to be implemented on
// IO Types that are phetioDynamicElement: true, such as PhetioGroup or PhetioCapsule elements.
stateToArgsForConstructor: supertype && supertype.stateToArgsForConstructor,
// {function(coreObject:*,stateObject:*)} For Reference Type Deserialization: Applies the stateObject value to
// the object. When setting PhET-iO state, this function will be called on an instrumented instance to set the
// stateObject's value to it.
// see https://github.com/phetsims/phet-io/blob/master/doc/phet-io-instrumentation-guide.md#three-types-of-deserialization
applyState: supertype && supertype.applyState, And methods that take an instance also run the validator. This issue seems ready to close. |
This issue is showing up in "open issue" searches. When I have seen that problem, before, it helps to reopen and reclose the issue. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Many of them are taylored to only reference serialization, for example toStateObject does not always get a PhetioObject, for Vector2 for example.
From slack:
The text was updated successfully, but these errors were encountered: