Add async event handling example with mutable state
This commit is contained in:
@@ -17,14 +17,20 @@ make
|
||||
Then serve locally and open in your browser:
|
||||
|
||||
```sh
|
||||
python3 -m http.server 9994 --directory examples/basics
|
||||
python3 -m http.server 9994 --directory examples
|
||||
```
|
||||
|
||||
Open `http://localhost:9994/basics/index.html` for the full example index, or go directly:
|
||||
|
||||
| URL | What it does |
|
||||
|-----|-------------|
|
||||
| `http://localhost:9994/hello.html` | Alerts "Hei maailma!" on load |
|
||||
| `http://localhost:9994/factorial.html` | Prompts for n, displays n! |
|
||||
| `http://localhost:9994/fibonacci.html` | Prompts for n, displays fib(n) |
|
||||
| `http://localhost:9994/basics/hello.html` | Alerts "Hei maailma!" on load |
|
||||
| `http://localhost:9994/basics/factorial.html` | Prompts for n, displays n! |
|
||||
| `http://localhost:9994/basics/fibonacci.html` | Prompts for n, displays fib(n) |
|
||||
| `http://localhost:9994/data-structures/lista.html` | List sorted ascending and descending |
|
||||
| `http://localhost:9994/data-structures/vektori.html` | Custom class, Euclidean length of [3,4] = 5 |
|
||||
| `http://localhost:9994/strings/merkkijono.html` | String length, concat, trim, split |
|
||||
| `http://localhost:9994/async/nappi.html` | Click handlers, mutable counter |
|
||||
|
||||
## What is Tampio?
|
||||
|
||||
@@ -46,10 +52,10 @@ See [`docs/cheatsheet.md`](docs/cheatsheet.md) for a map of Finnish grammatical
|
||||
| Directory | Contents |
|
||||
|-----------|----------|
|
||||
| `examples/basics/` | Hello world, factorial, Fibonacci |
|
||||
| `examples/data-structures/` | Lists, maps |
|
||||
| `examples/strings/` | String manipulation |
|
||||
| `examples/async/` | Promise / async usage |
|
||||
| `examples/program/` | A small complete program |
|
||||
| `examples/data-structures/` | Built-in list operations, custom class |
|
||||
| `examples/strings/` | String length, concat, trim, split |
|
||||
| `examples/async/` | DOM click handlers, mutable state |
|
||||
| `examples/program/` | A small complete program (coming soon) |
|
||||
|
||||
## Local Setup (without Docker)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user