🎉 Link with components of other files

This commit is contained in:
Andrés Moya 2020-09-10 15:42:11 +02:00
parent f837bad894
commit 1ad9a7f82f
11 changed files with 329 additions and 96 deletions

View file

@ -16,6 +16,7 @@
[potok.core :as ptk]
[reitit.core :as r]
[app.common.data :as d]
[app.config :as cfg]
[app.util.browser-history :as bhistory]
[app.util.timers :as ts])
(:import
@ -112,6 +113,19 @@
(def navigate nav)
(deftype NavigateNewWindow [id params qparams]
ptk/EffectEvent
(effect [_ state stream]
(let [router (:router state)
path (resolve router id params qparams)
uri (str cfg/public-uri "/#" path)]
(js/window.open uri "_blank"))))
(defn nav-new-window
([id] (nav-new-window id nil nil))
([id params] (nav-new-window id params nil))
([id params qparams] (NavigateNewWindow. id params qparams)))
;; --- History API
(defn initialize-history