0.0.1 • Published 1 year ago

stef v0.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

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()}`
})
0.0.1

1 year ago