Todo MVC implemented in ClojureScript using Christian Johansen's dumdom.
Feature complete (as far as TodoMVCs go). Includes support for:
- Adding, editing, searching and filtering todos
- Serializing and restoring from browser local state
- TodoMVC app CSS styles (https://github.com/tastejs/todomvc-app-css)
To get familiar with dumdom, I recommend the official README and the creator's talk on data-driven UIs. The coding styles discussed therein guided the design of this MVC. All mutability and state change in the app is contained in main.cljs
, and that in these 5 lines:
(dumdom/set-event-handler!
(fn [event actions]
(reset! store (model/handle-action action event @store))))
(add-watch store ::re-render (fn [_ _ _ _] (render!)))
(add-watch store ::save-state (fn [_ _ _ _] (save-state! storage-key)))