This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-12-21
Channels
- # adventofcode (60)
- # aleph (2)
- # announcements (3)
- # architecture (2)
- # babashka (12)
- # beginners (90)
- # calva (14)
- # cider (32)
- # clj-kondo (1)
- # clj-together (7)
- # cljsrn (4)
- # clojars (10)
- # clojure (161)
- # clojure-dev (110)
- # clojure-europe (58)
- # clojure-nl (3)
- # clojure-spec (35)
- # clojure-taiwan (1)
- # clojure-uk (24)
- # clojuredesign-podcast (3)
- # clojurescript (27)
- # conjure (47)
- # cursive (17)
- # data-science (1)
- # datomic (1)
- # depstar (6)
- # fulcro (20)
- # java (4)
- # jobs-rus (1)
- # luminus (4)
- # malli (10)
- # off-topic (8)
- # re-frame (4)
- # reagent (1)
- # reitit (9)
- # reveal (1)
- # rewrite-clj (8)
- # ring (3)
- # sci (44)
- # shadow-cljs (5)
- # spacemacs (6)
- # specter (8)
- # tools-deps (6)
- # vim (1)
- # xtdb (11)
Hello! I'm trying to use reitit frontend to redirect to another page. Basically, I have an AJAX request that loads some data that could take a long time to compute, so I want to have a loading page that redirects to the presentation page when the request is done (passing along the data) This is my current reitit setup which is almost entirely based on the reitit frontend easy github example
(defonce match (ratom/atom nil))
(defn current-page []
[:div
[:ul
[:li [:a {:href (rfe/href ::stats)} "Stats"]]]
(if @match
(let [view (:view (:data @match))]
[view @match]))
])
(def routes
[["/process"
{:name ::stats
:view process}]
["/results"
{:name ::results
:view stats/statistics-component}]])
(defn init! []
(rfe/start!
(rf/router routes {})
(fn [m] (reset! match m))
;; set to false to enable HistoryAPI
{:use-fragment true})
(rdom/render [current-page] (.getElementById js/document "app")))
I want to call /process, have it send the ajax request and call results and pass the response. I want /results to be a different page so that I don't have to download a bunch of css until I get the actual data.
How can I accomplish this with reitit?ok, nvm; I made some reitit glue https://github.com/tape-framework/router but it's predicated on specific infrastructure.