Prelude
A signal-based web library that lets you
develop in a familiar functional style
develop in a familiar functional style
Just write JavaScript!
Instead of JSX, Prelude uses HyperScript,
a DSL that lets you define components in JavaScript.
import {h, signal, render} from 'prelude'
function Counter() {
const n = signal(1)
const onClick = e => n(i => i+1)
return h('button', {onClick}, n)
}
render(Counter, window.counter)
Counter
Create a reactive value with const n = signal(1)
.
Define an event handler that increments the signal n(i=>i+1)
.
The function returned from h(...)
will render a HTML button
that handles onclick
events and displays the counter value.
Prelude has fine-grained reactivity and will only update
those parts of the DOM that needs to be changed.
Try in your Browser