-
-
Notifications
You must be signed in to change notification settings - Fork 28
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
Track parent tag of properties #13
Comments
Looks like there's two distinct problems here: P1) Provide type of parent element to keys (attrs / props / etc.) Regarding P1, see outwatch/outwatch#93 (comment) for a possible solution. The idea is that the key itself does not need the type, it's the Regarding P2 – Suppose we could indeed define the type of However, the So for things like As an alternative to |
Hmm instead of defining Note: I haven't tried to compile any of that. Not sure if it would work.
And then:
and similarly:
|
Currently, the children properties of a tag do not know, into which kind of tag they are inserted. There is no parent relation of the types.
For example, we can currently write something like
div(value := "bla")
, even though value is only defined on button, option, input, etc and not on div. Additionally, we can currently not type thecurrentTarget
property of events. This is always the object, on which the event listener was attached. So, if we writeinput(onChange := fun)
, we know that the type ofcurrentTarget
is alwayshtml.Input
.We would need a sane syntax for writing this. In scala I can only think about a macro for the
tags
, that inject the correct types into the code or adds some implicit. Any other ideas?Also see: outwatch/outwatch#93
The text was updated successfully, but these errors were encountered: