This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-12-20
Channels
- # aatree (257)
- # admin-announcements (13)
- # beginners (3)
- # boot (327)
- # cider (2)
- # cljs-dev (1)
- # clojure (127)
- # clojure-art (72)
- # clojure-russia (273)
- # clojure-sg (1)
- # clojurescript (39)
- # cursive (8)
- # datomic (6)
- # editors (2)
- # emacs (4)
- # hoplon (261)
- # immutant (2)
- # ldnclj (15)
- # liberator (10)
- # luminus (1)
- # off-topic (8)
- # om (9)
- # parinfer (1)
- # re-frame (11)
- # reagent (2)
- # yada (9)
Is it possible to call a Javascript function with a subscription? E.g.
(let [x (subscribe [:example])] (.foo js/Bar x))
I don't get it to work. 😕use @x
?
Depending on the type of @x
you may have to make it fit for js consumption
(.foo js/Bar (clj->js @x))
In my case, the call doesn't happen. Actually I don't have the code in front me. But does it matter that much, if the x is derefed or not. I mean the code should execute anyway, but give me an exception about the type of x. Isn't it?
Yep the code should execute. If it isn't then there's some other issue
But that code fragment above seems wierd.
Meant to be a form-2 component ?
Are you indeed trying to say .... if x
changes then call .foo
. on js/Bar
?
I have a form-3 component, which creates a div with an id. This component is called in a subscription. On willupdate the JS library is initiated with the ID from the subscription. At the didmount event I call a helper function with the upper code.
This has to access the Library to change some data.