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

improve doc for fromStateSetting #190

Closed
pixelzoom opened this issue Jul 14, 2020 · 3 comments
Closed

improve doc for fromStateSetting #190

pixelzoom opened this issue Jul 14, 2020 · 3 comments

Comments

@pixelzoom
Copy link
Contributor

The documentation for fromStateSetting doesn't tell me anything useful. I have no idea what it does, or how it's related to validation.

In PhetioGroup.js and PhetioDynamicElementContainer.js:

   * @param {boolean} [fromStateSetting] - used for validation during state setting.
  ...
  disposeElement( element, fromStateSetting ) {

In PhetioGroup.js:

   * @param {boolean} [fromStateSetting] - used for validation during state setting.
   * @returns {PhetioObject}
   * @public (PhetioGroupIO)
   */
  createIndexedElement( index, argsForCreateFunction, fromStateSetting ) {

In PhetioGroup.js, as an option to method clear:

    options = merge( {
      fromStateSetting: false, // used for validation during state setting (phet-io internal)
@samreid
Copy link
Member

samreid commented Jul 14, 2020

I took a look around but am not clear what is happening here. @zepumph can you please take a look?

@zepumph
Copy link
Member

zepumph commented Jul 22, 2020

Yes, this is a confusing parameter, and there isn't a clear single place to document all usages of it. I did the best I could of pointing to a single explanation. @pixelzoom please review.

@zepumph zepumph assigned pixelzoom and unassigned chrisklus and zepumph Jul 22, 2020
pixelzoom added a commit that referenced this issue Jul 27, 2020
@pixelzoom
Copy link
Contributor Author

Much better documentation, thanks. I fixed a few typos in the above commit. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants