createObservableArray¶
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/createObservableArray.ts for the most up-to-date information.
Overview¶
createObservableArray conforms to the Proxy interface, which is polluted with any
types. Therefore we disable this rule for this file. Creates an object that has the same API as an Array, but also supports notifications and PhET-iO. When an item is added or removed, the lengthProperty changes before elementAddedEmitter or elementRemovedEmitter emit.
@author Sam Reid (PhET Interactive Simulations)
Type ObservableArrayOptions¶
- length?: number
- elements?: T[]
- hasListenerOrderDependencies?: boolean
- elementAddedEmitterOptions?: StrictOmit<EmitterOptions, "tandem" | "parameters" | "phetioReadOnly">
Options for the array's child elements. Omitted options are the responsibility of the array. - elementRemovedEmitterOptions?: StrictOmit<EmitterOptions, "tandem" | "parameters" | "phetioReadOnly">
- lengthPropertyOptions?: StrictOmit<NumberPropertyOptions, "tandem" | "numberType" | "phetioReadOnly">
- & PhetioObjectOptions
Source Code¶
See the source for createObservableArray.ts in the axon repository.