phetsims / axon

Axon provides powerful and concise models for interactive simulations, based on observable Properties and related patterns.
MIT License
10 stars 8 forks source link

Review/adjust defaults for DynamicProperty type parameters #415

Closed samreid closed 1 year ago

samreid commented 1 year ago

In https://github.com/phetsims/axon/issues/342, we had a TODO:

// TODO: https://github.com/phetsims/axon/issues/342 Can OuterValueType default to TProperty?
export default class DynamicProperty<ThisValueType, InnerValueType = ThisValueType, OuterValueType = Property<InnerValueType>> extends ReadOnlyProperty<ThisValueType> implements LinkableProperty<ThisValueType> {
samreid commented 1 year ago

The defaults don't actually seem like they are being used much at the moment. I tried removing the defaults and the type checker still passed. I'm not sure what's best here.

Raising for dev meeting to ask: is this still important, and who should be in the subgroup?

jonathanolson commented 1 year ago

SR will remove the defaults

samreid commented 1 year ago

I removed the defaults. We may want to adjust this when we start porting more JS sims that use DynamicProperty to TypeScript. But for now perhaps it is OK to close.