This repo is for learning purposes
The idea of this project is a short way of web programming with only javascript.
Look at its potential:
let clicks = 0
const Message = p({
getProps: () => ({
innerText: `Clicks: ${clicks}`
})
})
const Counter = div({
getChilds: () => [
Message,
button({
getProps: () => ({
innerText: 'Add clicks',
onclick: () => {
clicks++
Message().update()
}
})
})
]
})
You can use it with vite vanilla:
npm init vite@latest fullyjs-test -- --template vanilla
Then add the package:
npm install fullyjs
Ready! you can already use it in src/main.js
import { autoElements, mountFullyJs } from 'fullyjs'
const { div, button } = autoElements
let counter = 0
const Button = button({
getProps: () => ({
innerText: `${counter} clicks.`,
onclick: () => {
counter++
Button().update()
}
})
})
const Home = div({
getProps: () => ({ innerText: 'Hello world!' }),
getChilds: () => [Button]
})
mountFullyJs('#app', Home)