@two-web/kit
v0.0.1-rc.4
Published
A collection of packages to enhance your 2web application
Readme
2Web Kit
A collection of packages to enhance your 2web application
| Package | State | | ---------------------------------------------- | ----- | | animations | 🔧 | | iron | 🔧 | | keyboard | 🔧 | | named-strings | 🔧 | | pre-fetcher | 🔧 | | route-guards | 🔧 | | signals | 🔧 | | ssr | 🔧 | | typescript | 🔧 | | 2js | 🔧 | | view-transitions | 🔧 | | vite-plugin | 🔧 |
❌ = Not working, 🔧 = Developer preview, ✅ = Production ready
Usage
Package Managers
You can install these packages into your project using your package manager.
$ npm install @two-web/kit
>OR you can add the following tag to your page's <head> tag.
<script type="module" src="https://cdn.jsdelivr.net/npm/@two-web/kit"></script>To use a package from this repository (either through node_modules or CDN), you can import the sub-package as a an esm module.
<script type="module">
import { EventHandler, QuerySelector, textContent } from "@two-web/kit/signals";
const target = new QuerySignal("#counter");
const countHandler = new EventHandler((event, value) => value + 1);
target.value.addEventListener("click", countHandler);
textContent(target.value, countHandler);
</script>
<button id="counter">0</button>