 ;; Below we create the interceptor chain shared by all event handlers
 ;; which manipulate todos.
 ;; A chain of interceptors is a vector.
-;; Explanation of `path` and `trimv` is given further below.
+;; Explanation of `path` and `trim-v` is given further below.
 (def todo-interceptors [check-spec-interceptor               ;; ensure the spec is still valid  (after)
                         (path :todos)                        ;; 1st param to handler will be the value from this path within db
                         ->local-store                        ;; write todos to localstore  (after)

  ;; The standard set of interceptors, defined above, which we
  ;; use for all todos-modifying event handlers. Looks after
  ;; writing todos to LocalStore, etc.
  ;; NOTE: this chain includes `path` and `trimv`
  todo-interceptors

  ;; The event handler function.

  ;; And, further, it means the event handler returns just the value to be
  ;; put into `:todos` path, and not the entire `db`.
  ;; So, a path interceptor makes the event handler act more like clojure's `update-in`
  (fn [todos [text]]   ;; because of trim-v,  the 2nd parameter is NOT [_ text]
    (let [id (allocate-next-id todos)]
      (assoc todos id {:id id :title text :done false}))))

