fullyjs
TypeScript icon, indicating that this package has built-in type declarations

0.3.2 • Public • Published

FullyJS

This repo is for learning purposes Transformice Emoticon No9

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)

Readme

Keywords

none

Package Sidebar

Install

npm i fullyjs

Weekly Downloads

2

Version

0.3.2

License

MIT

Unpacked Size

12.7 kB

Total Files

22

Last publish

Collaborators

  • francomg