Skip to content

Commit

Permalink
Factored out reusable PropertyIO type, see phetsims/unit-rates#207
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Nov 9, 2018
1 parent 4a9762e commit eef4587
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion js/BooleanProperty.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ define( function( require ) {
var Property = require( 'AXON/Property' );
var PropertyIO = require( 'AXON/PropertyIO' );

// constants
var BooleanPropertyIO = PropertyIO( BooleanIO );

/**
* @param {boolean} value - initial value
* @param {Object} [options]
Expand All @@ -32,7 +35,7 @@ define( function( require ) {
options.valueType = 'boolean'; // BooleanProperty requires values to be primitive booleans

assert && assert( !options.hasOwnProperty( 'phetioType' ), 'phetioType is set by BooleanProperty' );
options.phetioType = PropertyIO( BooleanIO );
options.phetioType = BooleanPropertyIO;

Property.call( this, value, options );
}
Expand Down

1 comment on commit eef4587

@pixelzoom
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.