Quick Start Guide
Installation
NPM
bash
npm install esor
CDN
html
<script type="module">
import {
component,
html,
signal,
} from "https://unpkg.com/esor/dist/esor.min.js";
</script>
Basic Use
javascript
import { component, html, signal } from "esor";
// Create a component
component("hello-world", () => {
const name = signal("Mundo");
return html`
<div>
<h1>Hola ${name}!</h1>
<input value=${name} oninput=${(e) => name(e.target.value)} />
</div>
`;
});
The component is shown below:
Project Use
html
<!DOCTYPE html>
<html>
<head>
<script type="module" src="./src/app.js"></script>
<script type="module" src="./components/hello-world.js"></script>
</head>
<body>
<hello-world></hello-world>
</body>
</html>