Solid.js timer primitives (setTimeout, setInterval) for F# Fable applications
$ dotnet add package TakinProfit.Solid.Primitives.TimerF# bindings for Solid.js and Ionic Framework using Fable
A professional .NET monorepo providing idiomatic F# bindings for building reactive web applications with Solid.js and Ionic Framework.
| Package | Description | NuGet |
|---|---|---|
| TakinProfit.Solid | Core Solid.js reactive primitives and control flow components | |
| TakinProfit.Solid.Ionic | Complete Ionic Framework component bindings (95 components) |
# For Solid.js only
dotnet add package TakinProfit.Solid
# For Ionic + Solid.js
dotnet add package TakinProfit.Solid.Ionic
open TakinProfit.Solid
open TakinProfit.Solid.Ionic
// Create reactive state
let count, setCount = Solid.createSignal 0
// Build UI with computation expressions
let app() =
Ion.app () {
Ion.header () {
Ion.toolbar () {
Ion.title () { "Counter App" }
}
}
Ion.content () {
Ion.button (onClick = fun _ -> setCount(count() + 1)) {
$"Count: {count()}"
}
}
}
// Render
Solid.render(app, Browser.Dom.document.getElementById("app"))Provides F# bindings for Solid.js reactive primitives:
// Create signal
let count, setCount = Solid.createSignal 0
// Create memo (derived value)
let doubled = Solid.createMemo(fun () -> count() * 2)
// Create effect (side effect)
Solid.createEffect(fun () ->
printfn $"Count is now: {count()}"
)// Conditional rendering
Solid.Show(``when`` = isVisible) {
Ion.div () { "Visible content" }
}
// With fallback
Solid.Show(``when`` = isLoading, fallback = Ion.spinner () {}) {
Ion.div () { "Loaded!" }
}
// Array iteration
Solid.For(each = items) { fun item getIndex ->
Ion.li () { $"{getIndex()}: {item.name}" }
}
// Switch/Match
Solid.Switch(fallback = Ion.div () { "Default" }) {
Solid.Match(``when`` = fun () -> status() = "loading") {
Ion.spinner () {}
}
Solid.Match(``when`` = fun () -> status() = "success") {
Ion.div () { "Success!" }
}
}95 fully-typed Ionic components:
// Button with all props
Ion.button (
color = IonColor.Primary,
fill = ButtonFill.Solid,
expand = ButtonExpand.Block,
onClick = handleClick
) {
"Click Me"
}
// Card layout
Ion.card () {
Ion.cardHeader () {
Ion.cardTitle () { "Card Title" }
Ion.cardSubtitle () { "Subtitle" }
}
Ion.cardContent () {
"Card content goes here"
}
}
// List with items
Ion.list () {
Solid.For(each = todos) { fun todo _ ->
Ion.item () {
Ion.label () { todo.text }
Ion.checkbox (``checked`` = todo.done) {}
}
}
}TakinProfit.Solid/
├── src/
│ ├── TakinProfit.Solid/ # Core Solid.js bindings
│ │ ├── Builder.fs # Computation expression builder
│ │ ├── Solid.fs # Reactive primitives
│ │ └── TakinProfit.Solid.fsproj
│ └── TakinProfit.Solid.Ionic/ # Ionic component bindings
│ ├── Types.fs # Enums and types
│ ├── Core.fs # Initialization
│ ├── Ionicons.g.fs # 1,357 icon constants
│ ├── Ion.g.fs # 95 generated components
│ └── TakinProfit.Solid.Ionic.fsproj
├── tests/ # 640+ unit tests
├── example/ # Example application
├── Taskfile.yml # Build automation
├── Directory.Build.props # Shared MSBuild config
└── TakinProfit.Solid.slnx # Solution file
# Using Task (recommended)
task build
# Using dotnet directly
dotnet build TakinProfit.Solid.slnxtask test
# Or manually
cd tests
dotnet fable . -o fable_output -e .jsx --lang jsx
bun test --preload ./setup.ts fable_outputtask example
# Or manually
cd example
dotnet fable . -o fable_output -e .jsx --lang jsx
bunx vite --hostRun task --list to see all available commands:
task build # Build all projects
task test # Run all tests
task pack # Create NuGet packages
task publish # Publish to NuGet
task generate # Run code generators
task example # Run example app
task clean # Clean all outputs
task info # Show project informationtask pack
# Creates packages in ./nupkgs/export NUGET_API_KEY=your-api-key
task publishtask publish:localAll components use a consistent CE pattern:
Ion.component (prop = value) {
// children here
}This provides:
Solid.js control flow components require accessor functions (not values):
// ✅ Correct - pass accessor
Solid.Show(``when`` = isVisible) { ... }
// ❌ Wrong - don't call it
Solid.Show(``when`` = isVisible()) { ... }This ensures SolidJS can track reactive dependencies properly.
All packages target netstandard2.1 for maximum compatibility:
Contributions welcome! Please:
task check to verify builds and testsMIT License - see LICENSE for details
Built with ❤️ using F# and Solid.js