GOX / LIBRARY

Examples

Go libraries. GOX components. Code for your next project.

components / typescript /typescript.gox

TypeScript

Transform TypeScript into browser-ready JavaScript.

Live example

Source

content/examples/counter.ts
1const button = document.querySelector<HTMLButtonElement>("#ts-counter");
2let count: number = 0;
3
4button?.addEventListener("click", () => {
5    count += 1;
6    button.textContent = `Clicks: ${count}`;
7});

Result

Compilation runs in the background and writes a static file under public/generated. On the first visit the browser may receive a 404 before it is ready; reload after compilation. Errors are logged on the server.

Live exampleGOX / Go