   (reagent/render [current-page] (.getElementById js/document "app")))
 
 (defn init! []
-  (load-hyphenation-patterns! @spelling @search)
+  (load-hyphenation-patterns! @spelling @word)
   (accountant/configure-navigation!
     {:nav-handler
      (fn [path]

(defonce app-state
  (reagent/atom
   {:hyphenations []
    :search ""
    :spelling 1}))

(def search (reagent/cursor app-state [:search]))
(def spelling (reagent/cursor app-state [:spelling]))

(defn update-hyphenations! [f & args]
  (apply swap! app-state update-in [:hyphenations] f args))

  (update-hyphenations! (fn [hs] (vec (remove #(= % h) hs))) h))

(defn load-hyphenation-patterns!
  [spelling word]
  (ajax/GET "/api/words"
            :params {:spelling spelling :search word}
            :handler (fn [hyphenations] (swap! app-state assoc :hyphenations hyphenations))
            :error-handler (fn [details]
                             (.warn js/console
