stef
v0.0.1
Published
Tiny javascript reactivity inspired by solid-js
Downloads
4
Maintainers
Readme
reactive
Tiny javascript reactivity inspired by solid-js
Example
<button type="button" id="button">Count: 0</button>
import { effect, state } from 'stef'
const [count, setCount] = state(0)
const increment = () => setCount(count() + 1)
const button = document.getElementById('button') as HTMLButtonElement
button.addEventListener('click', increment)
effect(() => {
button.textContent = `Count: ${count()}`
})