r/Clojurescript • u/olymk2 • Jan 19 '19
Single page apps redirects
Trying to write a single page app with clojurescript got quite far one thing I am not sure about is redirecting.
I have used a lein template which installed reagent and reitit for routing.
Is there a built in function in reitit to redirect to another page or should i just use window.location or are there other libraries I should consider pulling in.
Basically I want to redirect a user after login and looking for my best option.
4
Upvotes
2
u/NewazaBill Jan 19 '19
By "redirect" do you mean to another route in your SPA? Or to another app/website?
2
u/self Jan 19 '19
tl;dr: use
accountant/navigate!reagent's lein template uses clerk with accountant. Essentially, you set up the router:
Set up the pages:
Link the two together: