Skip to content

Commit

Permalink
Adding ReadOnlyProperty type in Property
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanolson committed Mar 4, 2022
1 parent b3d5714 commit 2dc362b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions js/Property.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ type PropertyOptions<T> = Partial<PropertyDefinedOptions> & {
isValidValue?: any
} & PhetioObjectOptions;

// a Property (can't be a TinyProperty) with all of the value-mutation removed.
export type ReadOnlyProperty<T> = Omit<Property<T>, 'set' | 'reset'> & { readonly value: T; };

class Property<T> extends PhetioObject implements IProperty<T> {

// Unique identifier for this Property.
Expand Down

1 comment on commit 2dc362b

@pixelzoom
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.