Detalhes do pacote

sigment

sigmentjs626MIT1.3.3

A lightweight reactive JavaScript framework built with signals and vanilla JS — no virtual DOM, no JSX, no transpilation.

Javascript, Vanilla, Reactive, Sigment

readme (leia-me)

sigment

Sigment – A lightweight reactive JavaScript framework built with signals and vanilla JS.

🚀 Installation

npm install sigment

Usage

/* if import from sigment not work then you can add to index.html this code  
    <script type="importmap">
      {"imports": {"sigment": "/node_modules/sigment/dist/index.js"}}
    </script>
*/

import  "sigment";

// Tag functions (div, h1, p, button, etc.) are globally available after this import

function ComponentName() {

    return div("hello sigment");

}

document.body.appendChild(ComponentName());


// Reactive counter example:

import { createSignal } from "sigment";

function Counter() {
  const [count, setCount] = createSignal(0);

  return div(

    h1('Sigment Reactive Framework'),
    button({ onClick: () => setCount(count() + 1) }, 'Increment'),
    p(() => `Count is: ${count()}`)

  )

}

document.body.appendChild(Counter());