-
-
Notifications
You must be signed in to change notification settings - Fork 102
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 attribute support into New function. #199
Conversation
Not sure why the unit tests didn't diff with an indent, not too much of a problem though. |
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.
Should there also be an AttributeOut
feature as part of this, equivalent to the regular property Out
functionality?
Actually not a bad idea, it's probably not best having the same issue as before when |
Thanks for the PR! This won't be included in v0.2 since that's literally about to release, but I'll definitely look into including this alongside the rest of the instance changes planned for v0.3 :) |
You're welcome! Hopefully it gets added in v0.3 provided that my code is up to standard 😃 |
Gonna mark this as a draft for now until I sort out the indenting problems! |
Finally! I got the indents to work, I messed around with my VSC settings and stopped it from adding spaces, then went through the files and fixed it. If there's still problems please re-review, going to mark ready again. |
Alright, looks good to me. What do you guys think? |
|
This PR fixes #1 with a relatively simple API to use.
Attributes can be implemented as follows:
Attribute supports state binding, meaning if you set an attribute to a state value, it will automatically update when that state value changes.
AttributeChanged works similarly to OnChange, where you give it an attribute name, and when that attribute changes, it will run your specified callback.
I've also added some unit tests for attributes, however they might not be the greatest, so feel free to give any feedback for improvement!
Apologies if this PR isn't the best, I haven't done this before, however I'm open to any suggestions!