   (if (use-html5-history)
     (:base-path @config)))
 
-(defn setup-history []
+(defn setup-history [p]
   (when (nil? history)
-    (set! history (create-history))
+    (set! history (create-history p))
     (swap! page-state assoc :has-history (some? history))
     (when-let [h history]
       (evt/listen h hevt/NAVIGATE

      (swap! config merge conf)
      (when page-name
        (set-start-page page-name))
      (setup-history)
      (set! (.-title js/document) (get-title))
      (reagent/render-component (body)
                                (.' js/document :body)))))

           (.isSupported Html5History)
           (#{"http:" "https:"} proto)))))

(defn create-history [p]
  (if (use-html5-history)
    (doto (Html5History.)
      (.setUseFragment false))
    (let [h (History.)]
      (when p
        (.setToken h p))
      h)))

(def history nil)

