Skip to content

OrIO

Overview

Parametric IOType that adds support for serializing an element as multiple types, as a composite. Serialization occurs via a first-come-first-serialize basis, where the first parameterType will be the

Sample usage:

self.numberOrStringProperty = new Property( 'I am currently a string', { tandem: Tandem.GENERAL_MODEL.createTandem( 'numberOrStringProperty' ), phetioValueType: OrIO( [ StringIO, NumberIO ] ) } );

@author Michael Kauzmann (PhET Interactive Simulations)

Source Code

See the source for OrIO.ts in the tandem repository.