todomvc.todomvc — todomvc.clj,
todomvc_controller.clj.
Everything so far, together, in :memory only.
State machine
stateDiagram-v2
direction LR
[*] --> displayed : INIT / seed
displayed --> displayed : ADD · TOGGLE · DESTROY · TOGGLE_ALL · CLEAR_COMPLETED · FILTER · EDIT · SAVE_EDIT · CANCEL_EDIT
What to look at
toggle?id=3, filter?filter=active. They arrive as
strings in the action's second argument (param-id parses them); unknown values fall back.newTodo, editText) so $todos1.newTodo is a valid
identifier in Datastar expressions."data-on:keydown" "evt.key==='Enter' && @post(…); evt.key==='Escape' && @post(…)".editingId is nil when idle — a JSON null in the store, back to nil on the next request.:memory; the
machine is one state with ten actions, each a small pure function over :memory.Spec: block 5 in examples_test.clj (add trims and clears, params are parsed, filters,
toggle-all, clear-completed, editing round-trip, blank save deletes).
Can you improve this documentation?Edit on GitHub
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |