Skip to content

Property

Overview

Class Property

Adds initial value and reset, and a mutable interface.

@author Sam Reid (PhET Interactive Simulations)

import { Property } from 'scenerystack/axon';

Constructor

new Property( value : T, providedOptions? : PropertyOptions<T> )

Instance Methods

getInitialValue() : T

Returns the initial value of this Property.

setInitialValue( initialValue : T )

Stores the specified value as the initial value, which will be taken on reset. Sims should use this sparingly, typically only in situations where the initial value is unknowable at instantiation.

reset()

set( value : T )

Overridden to make public

isSettable() : boolean

Source Code

See the source for Property.ts in the axon repository.