          ; do nothing, only for a demo
          :sample-action model
 
-         [:set-visibility key]
-         (assoc model :visibility key)
-
          [:update-field val]
          (assoc model :field val)
 

  (-remove-todos model #(= (:id %) id)))

;;;;;;;;;;;;;;;;;;;;;;;; Control
(def -visibility-spec
  [{:key :all :title "All" :href "#" :token ""}
   {:key :active :title "Active" :href "#/active" :token "/active"}
   {:key :completed :title "Completed" :href "#/completed" :token "/completed"}])

(defn control
  [_model_ signal dispatch]
  (match signal
         :on-connect (dispatch :sample-action)

         ; will come from router middleware
         [::routing/on-navigate token]
         (do
           ;(println "    token =" (pr-str token))
           (when-let [match (->> -visibility-spec
                               (filter #(= (:token %) token))
                               first)]
             ;(println "      route match =" (pr-str match))
             (dispatch [:set-visibility (:key match)])))

         ; will come from devtools
         ::devtools/on-did-replay nil


(defn init
  []
  {:field   ""
   ; list of maps
   :todos   (list (-init-todo 1 "Finish this project")
                  (-init-todo 2 "Take a bath"))
   :next-id 3})

(defn -update-todos*
  [model pred f & args]
