-
Notifications
You must be signed in to change notification settings - Fork 2
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
base: Master
Are you sure you want to change the base?
Conversation
Identical to the `State.fromAttribute` method, but for Roblox Values Instances.
There was a problem hiding this 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
function State.Interface.fromValue(object: Instance & { Value: any? }): State | |
function State.Interface.fromValue(object: ValueBase & { Value: any? }): State |
There was a problem hiding this comment.
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? } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@param object Instance & { Value: any? } | |
@param object ValueBase & { Value: any? } |
Identical to the
State.fromAttribute
method, but for Roblox Values Instances.