         pr (get components 4)
         current-pr (when (= (get components 3) "pull") {:repo repo :pr pr})
         view (if (util/qs ".file-diff-split") :split :unified)]
+    (swap! state assoc :commit-count (count (util/qsa ".commit-id")))
     (swap! state assoc :current-pr current-pr)
     (swap! state assoc :view view)))
 

(enable-console-print!)

(def state (atom {:current-pr {} ;; {:repo "smcgivern/gitique" :pr "1"}
                  :base-commit nil ;; the start point for the diff
                  :all-commits '() ;; all of the commits found on the page
                  :files '() ;; the files property of the GitHub API response

  (when pjax-wrapper
    (let [is-valid-mutation? #(and (= (.-type %) "childList") (seq (.-addedNodes %)))
          observer (js/MutationObserver. #(when (some is-valid-mutation? %) (main)))]
      (.observe observer pjax-wrapper #js{:childList true :attributes false :characterData false :subtree true})))
  (main))
