| a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | t | u | v | w | x | y | z |
T is for Templates
@cursorsdottsx/t
Ok, what's another templating library doing? Well thanks for asking. This one is a templating library that is stateful and totally does not copy React. Totally. 100%.
const { render, useState } = Templates;
const [counter, setCounter] = useState(0);
render(document.getElementById("test"), `<button onclick="setCounter(counter + 1)">Clicked {{ counter }} times!</button>`, { counter });
Well to be fair the templating part is Vue-ish, and what's more is that this library is under 150 lines!
Usage
Import the library however you wish, then use the Templates
object like in the example.
const Templates = require("@cursorsdottsx/t");
import Templates from "@cursorsdottsx/t";
WARNING: THIS LIBRARY DOES NOT PREVENT XSS IM TOO LAZY TO DO THAT