-
Notifications
You must be signed in to change notification settings - Fork 6
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
replace SoluteIO ? #54
Comments
Signed-off-by: Chris Malley <[email protected]>
I feel like SoluteIO is in good shape, it is not too complicated and what boilerplate code it does have, it is unclear how we would factor it out. Marking for discussion with @zepumph and @chrisklus on Wednesday to double check and discuss further. |
Discussed at phet-io team meeting today. We like that SoluteIO has a descriptive name and a place for type specific documentation. For example seeing We do agree though that its reference-like qualities for serialization should be factored out. All the type checking can happen in a new type // Copyright 2017-2018, University of Colorado Boulder
//TODO replace this with StateObjectIO, https://github.com/phetsims/molarity/issues/54
/**
* IO type for Solute
*
* @author Chris Malley (PixelZoom, Inc.)
*/
define( function( require ) {
'use strict';
// modules
var molarity = require( 'MOLARITY/molarity' );
var ReferenceIO = require( 'TANDEM/types/ReferenceIO' );
var phetioInherit = require( 'TANDEM/phetioInherit' );
/**
* @param {Solute} solute
* @param {string} phetioID
* @constructor
*/
function SoluteIO( solute, phetioID ) {
ReferenceIO.call( this, solute, phetioID );
}
phetioInherit( ReferenceIO, 'SoluteIO', SoluteIO, {}, {
documentation: 'The solute for the sim',
} );
return molarity.register( 'SoluteIO', SoluteIO );
} ); Assigning to @samreid to investigate. Let us know if you need help. |
I added ReferenceIO and used it for SoluteIO. Seems to be working ok in studio=>launch. @zepumph can you take a look? |
Things are looking pretty good while looking at the code. Full review is on hold until phetsims/tandem#85 is sort out. |
This is all looking really good. Now SoluteIO looks like:
|
In SoluteIO.js:
//TODO replace this with StateObjectIO, see phetsims/phet-io#1100
phetsims/phet-io#1100 is closed and
StateObjectIO
no longer exists. Please advise on what needs to be done here.The text was updated successfully, but these errors were encountered: