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

⭐ Implement State.fromValue #20

Open
wants to merge 1 commit into
base: Master
Choose a base branch
from

Conversation

medallyon
Copy link

Identical to the State.fromAttribute method, but for Roblox Values Instances.

Identical to the `State.fromAttribute` method, but for Roblox Values Instances.
Copy link
Owner

@4x8Matrix 4x8Matrix left a comment

Choose a reason for hiding this comment

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

I've requested small type changes, we could further optimise types by setting the type to ValueBase.

...
```
]=]
function State.Interface.fromValue(object: Instance & { Value: any? }): State
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
function State.Interface.fromValue(object: Instance & { Value: any? }): State
function State.Interface.fromValue(object: ValueBase & { Value: any? }): State

Copy link
Author

Choose a reason for hiding this comment

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

I had it as ValueBase at first but opted for Instance instead as it adds nothing; none of the Value classes such as StringValue even inherit from the ValueBase class. It doesn't contain the one thing all of the Value classes share: a Value property - I don't even know why it exists. Moreover, everyone is familiar with Instance so I want to argue it's easier comprehension, even if nothing changes Intellisense-wise.

I have no problem conforming it but I thought I'd give my thoughts 🍀

@function fromValue
@within State

@param object Instance & { Value: any? }
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
@param object Instance & { Value: any? }
@param object ValueBase & { Value: any? }

@4x8Matrix 4x8Matrix added enhancement New feature or request good first issue Good for newcomers labels Mar 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants