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.fs
there 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.js
you'll see we're using a javascript file to export everything from our component and from oursrc/Library.fs
file this is to allow consumers to opt in for individual components rather than all of them.Consume the component.
Inside
index.html
you'll see that we are consuming our web component by callingregisterAll()
which was defined inLibrary.fs
we 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.