Fork me on GitHub
#keechma
<
2018-04-24
>
sooheon00:04:25

@mihaelkonjevic I’m looking at the redirect mechanism here: https://github.com/gothinkster/clojurescript-keechma-realworld-example-app/blob/master/src/cljs/realworld/controllers/redirect.cljs Is there any way to pp/redirect! to a different domain? I.e. pass it a full-on URL, not just params

sooheon00:04:58

I guess I can just do plain js. Is something like this OK?

(defn redirect! [route app-db]
  (let [redirect-to (get-redirect route app-db)]
    (when redirect-to
      (if (= redirect-to ::some-other-site)
        (.assign js/window.location "")
        (pl/redirect! redirect-to)))))

mihaelkonjevic06:04:18

@sooheon just use plain js. Redirect will use it under the hood after it constructs the url from the passed map