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

[Doc] fixed missing "scope" parameter in Computed and For docs #341

Merged
merged 7 commits into from
Jun 13, 2024

Conversation

tapple
Copy link
Contributor

@tapple tapple commented Jun 2, 2024

If adding the unused and optional parameters to callbacks is not desirable, I can reduce the changes to just the ones that are actually an error, namely these commits:

  1. For: d268b2c
  2. Computed: 9042cd0

This would reduce the PR from 20 to 8 changed files (EDIT: done)

@tapple tapple changed the title fixed missing "scope" parameter in Computed and For docs [Doc] fixed missing "scope" parameter in Computed and For docs Jun 2, 2024
Copy link
Contributor

@alexasterisk alexasterisk left a comment

Choose a reason for hiding this comment

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

A lot of these are unnecessary parameters as they are never referenced. Also, usage of these should not be publicly displayed as it may be more confusing for regular users of Fusion. If someone read scope:Computed(function(use, scope) it may not make implicit sense as scope is already defined and providing it here would overshadow it when it doesn't make any sense to do so.

There are a few swapped parameters that this PR has that do need to be changed and also the index.md on the Docs is still written for v2 so I have provided more changes to this PR. I am curious about test/Spec/State/For.spec.luau as For isn't a method but a type but is being treated as a method here. I did not change that in this PR as it didn't fit and I may just be missing an internal method.

@dphfox
Copy link
Owner

dphfox commented Jun 11, 2024

Yeah I don't plan to expose the parameters if they're not used. It makes code more confusing, and it's perfectly idiomatic to omit them if they're not used (part of the reason they're ordered the way they are is because of their usage frequency, so this is part of the API design explicitly).

@tapple
Copy link
Contributor Author

tapple commented Jun 12, 2024

All requested changes were made. This almost entirely was just reverting the 2 commits I expected to need to revert, so, sorry to waste your time with those. The only other changes were making sure Computed was always documented as scope:Computed

@dphfox
Copy link
Owner

dphfox commented Jun 13, 2024

No worries! I appreciate that you thought to try and help out. That's always positive :)

@dphfox dphfox merged commit 34f278c into dphfox:main Jun 13, 2024
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

Successfully merging this pull request may close these issues.

3 participants