Skip to content

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
@4x8Matrix
Copy link
Owner

4x8Matrix commented Jul 26, 2025

State package has now been deprecated, I have no intentions of improving, or making additions to it. I'd encourage you fork the package, and make the additions if you're depending on these changes being merged.

@4x8Matrix 4x8Matrix closed this Jul 26, 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