 (ns frontend.todos
   (:require [cljs.core.match :refer-macros [match]]
             [reagent.core :as r]
-            [com.rpl.specter :as s]
-            [goog.events]
-            [goog.history.EventType :as EventType]))
+            [com.rpl.specter :as s]))
 
 ;;;;;;;;;;;;;;;;;;;;;;;; Model
 (defn -init-todo

;;;;;;;;;;;;;;;;;;;;;;;; View model
(defn view-model
  [model]
  (assoc model
    :todos (filter (case (:visibility model)
                     :all (constantly true)
                     :active (complement :completed?)
                     :completed :completed?)
                   (:todos model))
    :has-todos? (-> (:todos model) count pos?)
    :active-count (->> (:todos model)
                       (filter (complement :completed?))
                       count)
    :has-completed-todos? (->> (:todos model)
                               (filter :completed?)
                               count
                               pos?)
    :all-completed? (every? :completed? (:todos model))))

;;;;;;;;;;;;;;;;;;;;;;;; View
(defn -enter-key?

;;;;;;;;;;;;;;;;;;;;;;;; Spec
(defn new-spec
  [history]
  {:init       init
   :view-model view-model
   :view       view
   :control    (new-control history)
   :reconcile  (new-reconcile history)})