This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-07-06
Channels
- # aws-lambda (6)
- # babashka (1)
- # beginners (204)
- # calva (10)
- # chlorine-clover (17)
- # cider (57)
- # cljs-dev (3)
- # cljsrn (3)
- # clojure (148)
- # clojure-bangladesh (1)
- # clojure-berlin (3)
- # clojure-europe (30)
- # clojure-france (1)
- # clojure-italy (4)
- # clojure-nl (5)
- # clojure-spec (4)
- # clojure-uk (14)
- # clojurescript (15)
- # code-reviews (8)
- # conjure (27)
- # data-science (9)
- # datomic (38)
- # duct (6)
- # figwheel-main (11)
- # fulcro (78)
- # helix (11)
- # jobs (1)
- # malli (18)
- # meander (22)
- # mount (4)
- # nrepl (3)
- # off-topic (93)
- # pathom (2)
- # pedestal (4)
- # re-frame (5)
- # reagent (6)
- # reitit (1)
- # ring-swagger (1)
- # sci (1)
- # shadow-cljs (19)
- # spacemacs (1)
- # sql (1)
- # tools-deps (76)
- # unrepl (1)
- # vim (5)
- # xtdb (8)
Does anybody know how to write the following syntax in clojurescript window.location.href="
? So far I've tried (set! (. js/window location -href) "
The error that I am getting is *set! target must be a field or a symbol naming a var*
(. js/window location -href)
returns the data at that location
@noisesmith thanks a lot for the reply. What I'm trying to do is set the onclick attribute to location.href='
within the input tag to make a button which goes to another url, only by using reagent. I have implemented the html form before this, but strangely enough I'm redirected to a different url ( in this case an authorization end point not exactly valid or matching to where it needs to go). I was simply trying to check what happens if I use an input of type button acting as the link instead, but the real issue is with the form with the misdirected action.. any help would be appreciated!
@baishakhi almost correct, should be: (set! (.. js/window -location -href) ...)
@thheller that worked. Thanks!
you can’t turn an async process into a blocking one in JS, so you’ll need to put your code that takes from the channel inside a go
form
i’m using re-frame so this is going to be tricky. i need to read from local storage before executing the event using a coeffect. i’ll maybe check over in re-frame 😕
yeah coeffects are fundamentally synchronous, so I don’t think you’ll be able to use cofx for this