Skip to content

OrientationPair

Overview

An object that contains a value for each item in an enumeration.

@author Jonathan Olson <jonathan.olson@colorado.edu>

Class OrientationPair

import { OrientationPair } from 'scenerystack/phet-core';

Constructor

new OrientationPair( horizontal : T, vertical : T )

Instance Methods

with( orientation : Orientation, value : T ) : OrientationPair<T>

map( mapFunction : ( value: T, orientation: Orientation ) => T ) : OrientationPair<T>

Returns a new EnumerationMap with mapped values.

@param mapFunction - function( {}, {TEnumeration.} ): {*} @returns With the mapped values

Static Methods

create( factory : ( o: Orientation ) => T ) : OrientationPair<T>

Creates an orientation pair based on a factory method.

@param factory - called once for each orientation to determine the value.

Source Code

See the source for OrientationPair.ts in the phet-core repository.