Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DerivedProperty listener must provide all parameters to pass type check #375

Closed
zepumph opened this issue Feb 28, 2022 · 2 comments
Closed
Assignees

Comments

@zepumph
Copy link
Member

zepumph commented Feb 28, 2022

None of these parameters are used:

https://github.com/phetsims/ratio-and-proportion/blob/def1127874b5e2b7fe470f065a78549480789506/js/discover/view/DiscoverScreenSummaryNode.ts#L90

But if I remove them, then the DerivedProperty creation fails with this error:

TS2345: Argument of type '[Property, EnumerationProperty, Property, IReadOnlyProperty, IReadOnlyProperty<...>]' is not assignable to parameter of type '[]'.   Source has 5 element(s) but target allows only 0.

@jonathanolson, do you have any ideas about how to make this more flexible?

@zepumph
Copy link
Member Author

zepumph commented Feb 28, 2022

Look what I just found as a workaround from a couple months ago.

https://github.com/phetsims/ratio-and-proportion/blob/95e7ea7adbc1522d9f518719664674f397d972be/js/common/view/BothHandsPDOMNode.ts#L218

Looks like you are likely aware of this problem then!

@samreid
Copy link
Member

samreid commented Jul 1, 2022

I think this was fixed in #395, closing (but please reopen if I'm wrong).

@samreid samreid closed this as completed Jul 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants