-
Notifications
You must be signed in to change notification settings - Fork 5
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
How to inherit? #16
Comments
This is an interesting idea. 👍 Could you please provide the TypeScript snippet that correspond to what we are discussing? This is because it helps visualise what the TypeScript code is and how each element should transformed into F#. Does this means that for each interface we need to generate a corresponding If I understand correctly, this means that And the When using Web Component (not limited to), is there cases where we want to inherit from several element or is it always only one? |
Yes! You are right. This applies to any interface. On your last question, I think JS class can only inherit from one class. (I will add some more snippets later..) |
Something I just thought, is that because of the line Luckily using the following: [<Global>]
member _.this : Browser.Types.HTMLElement =
nativeOnly generates the same code and means that we have a pure binding. Having pure binding is important because otherwise, you need to include the F# files in the |
TS can inherit interfaces, F# not.
This can be bypassed by creating a separate module that has classes of the same name:
Generated code from Types.Web :
In user code a Web Component can be made like this:
this gnerates:
see REPL
The text was updated successfully, but these errors were encountered: