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

Missing dependency for DerivedProperty #211

Closed
pixelzoom opened this issue Nov 9, 2023 · 2 comments
Closed

Missing dependency for DerivedProperty #211

pixelzoom opened this issue Nov 9, 2023 · 2 comments
Assignees

Comments

@pixelzoom
Copy link
Contributor

Discovered in phetsims/axon#441 ...

Relevant code and fix in IdealGasLawContainer:

-   this.isOpenProperty = new DerivedProperty( [ this.lidIsOnProperty, this.lidWidthProperty ],
+   this.isOpenProperty = new DerivedProperty( [ this.lidIsOnProperty, this.lidWidthProperty, this.boundsProperty ],
-     ( lidIsOn, lidWidth ) => {
+     ( lidIsOn, lidWidth, bounds ) => {
        return !lidIsOn || this.getOpeningWidth() !== 0;
      } );

this.getOpeningWidth calls this.getOpeningLeft, which calls this.left, which is a getter that uses this.boundsProperty.

This needs to be tested before pushing.

@pixelzoom
Copy link
Contributor Author

In 699b3b8, @samreid added accessNonDependencies: true to temporarily silence this problem.

@pixelzoom pixelzoom changed the title Missing dependency for isOpenProperty Missing dependency for DerivedProperty Nov 14, 2023
pixelzoom added a commit that referenced this issue Nov 18, 2023
@pixelzoom
Copy link
Contributor Author

Fixed in the above commit. Closing.

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

1 participant