Replies: 1 comment 3 replies
-
|
That would be fine. It should continue to work with the string to maintain backwards compatibility. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Currently, when using
DOMNode.watch()to observe reactive attributes on other widgets, you must pass the attribute name as a string:It's nice and easy, but unfortunately, it's not properly integrated with type-checkers.
Let me show a situation that I faced:
So, I basically made a typo and was able to find it only at runtime; there were no linter errors.
I propose to allow use
Reactiveclass-var attr inwatchmethod, so example above will look like this:You can even add additional checks that will make sure that you are using
Reactiveclass-var attr from the correct class:I already implemented this feature, and now
tywill give you an error for invalid usage:Let me know what do you think about this feature.
Beta Was this translation helpful? Give feedback.
All reactions