Skip to content

Property

Under Construction

This documentation is auto-generated, and is a work in progress. Please see the source code at https://github.com/phetsims/axon/blob/main/js/Property.ts for the most up-to-date information.

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.