                      "tweet__action--active")
             :onClick (fn [e]
                        (.preventDefault e)
-                       (swap! state
-                              update :tweets
-                              update-tweet (:id tweet)
-                              update :favorite? not))}
+                       (->
+                         (js/fetch (str "/" (:id tweet) "/favorite")
+                                   #js {:method "POST"})
+                         (.then (fn [_]
+                                  (fetch-global-page)))))}
            [:span.star.tweet__action-icon]
            "Favorite"]]]))))
 

    [cljs.reader :refer [read-string]]))

(defonce state (atom {:page {:name :home}}))

(defn update-tweet
  [tweets id f & args]

                                        (if (= page (:page state))
                                          (assoc-in state [:page :data] x)
                                          state)))))))

(defn fetch-global-page
  []
  (fetch-page (-> @state :page)))

(defn nav-link
  [opts & children]
