Merge remote-tracking branch 'origin/main' into staging

This commit is contained in:
Alejandro Alonso 2024-09-06 13:50:09 +02:00
commit 5b0331611d
5 changed files with 62 additions and 3 deletions

View file

@ -13,9 +13,10 @@
[app.main.data.events :as ev]
[app.util.browser-history :as bhistory]
[app.util.dom :as dom]
[app.util.globals :as globals]
[app.util.globals :as globals]
[app.util.timers :as ts]
[beicon.v2.core :as rx]
[cuerdas.core :as str]
[goog.events :as e]
[potok.v2.core :as ptk]
[reitit.core :as r]))
@ -149,6 +150,20 @@
[]
(set! (.-href globals/location) "/"))
(defn nav-raw
[href]
(ptk/reify ::nav-raw
ptk/EffectEvent
(effect [_ _ _]
(set! (.-href globals/location) href))))
(defn get-current-path
[]
(let [hash (.-hash globals/location)]
(if (str/starts-with? hash "#")
(subs hash 1)
hash)))
;; --- History API
(defn initialize-history