You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(nsfrontend.routes
(:require [secretary.core :as sec :refer-macros [defroute]]
[goog.events :as events]
[goog.history.EventType :as EventType]
[frontend.state :refer [change-state]])
(:import goog.history.Html5History))
(defoncehistory (Html5History.))
;; We can switch routes through this function
(defntrans
[path]
(.setToken history path))
(defroute"/" []
(change-state ...))
(defroute"/post/:slug" {:as params}
(change-state ...))
(defn-on-popstate
[e]
(-> e .-token sec/dispatch!))
(events/listen history EventType/NAVIGATE on-popstate)
;; We can remove # prefix this way
(doto history (.setEnabledtrue)
(.setPathPrefix"")
(.setUseFragmentfalse))
Would be nice to have a reference example that does not use the # prefix.
The text was updated successfully, but these errors were encountered: