fullyjs
v0.3.2
Published
This repo is for learning purposes [![Transformice Emoticon No9](https://static.wikia.nocookie.net/transformice/images/1/11/9_Emoticon.png/revision/latest/scale-to-width-down/29?cb=20180322134502)](#)
Downloads
6
Readme
FullyJS
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()
}
})
})
]
})
Installation guide
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)