fsharp-components v0.0.4
FS Components
This is a sample repo (or not? depends on the community 😁) of how can you create web-components with F# visit
A quick overview of how everything is working together
Author Component.
Check
src/Message.fsthere you will see how we add styles, initialize properties, handle classes, dispatch events and define a register function for our componentExport component.
Inside
src/Main.jsyou'll see we're using a javascript file to export everything from our component and from oursrc/Library.fsfile this is to allow consumers to opt in for individual components rather than all of them.Consume the component.
Inside
index.htmlyou'll see that we are consuming our web component by callingregisterAll()which was defined inLibrary.fswe do this mainly in development to just access all of the components, but ideally we should import only the ones we're going to use.