TReadOnlyProperty¶
Overview¶
A simple read-only Property/TinyProperty-like interface
@author Sam Reid (PhET Interactive Simulations) @author Jonathan Olson <jonathan.olson@colorado.edu>
Type TReadOnlyProperty¶
See comments in Property.ts / TinyProperty.ts
- get: () => T
- valueComparisonStrategy: ValueComparisonStrategy<T>
- isDisposed?: boolean
Type PropertyLazyLinkListener¶
( value: T, oldValue: T, tinyProperty: TReadOnlyProperty<T> ) => void
Type PropertyLinkListener¶
Even though these are the same types used for TProperty, it is vital that the tinyProperty parameter remains TReadOnlyProperty to avoid contravariance type errors that may not be checked by TypeScript because contravariance type checking is ignored in "method" types but not in "property" types. See https://github.com/phetsims/axon/issues/428#issuecomment-2033071432
( value: T, oldValue: T | null, tinyProperty: TReadOnlyProperty<T> ) => void
Type PropertyListener¶
PropertyLinkListener<T> | PropertyLazyLinkListener<T>
Source Code¶
See the source for TReadOnlyProperty.ts in the axon repository.