This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-02-11
Channels
- # beginners (2)
- # boot (97)
- # cider (58)
- # cljs-dev (10)
- # cljsrn (7)
- # clojure (79)
- # clojure-austin (4)
- # clojure-brasil (1)
- # clojure-france (1)
- # clojure-russia (42)
- # clojure-spec (12)
- # clojure-uk (22)
- # clojurescript (150)
- # clr (1)
- # conf-proposals (7)
- # core-matrix (2)
- # cursive (4)
- # datomic (9)
- # jobs (2)
- # klipse (28)
- # leiningen (3)
- # lumo (8)
- # nrepl (1)
- # off-topic (28)
- # om (18)
- # om-next (2)
- # perun (17)
- # planck (9)
- # rdf (1)
- # re-frame (18)
- # reagent (7)
- # ring (2)
- # rum (1)
- # specter (11)
- # test-check (3)
- # untangled (1)
- # yada (7)
@shader, I too am interested in getElementById of a hiccup component. If you find anything, please share.
I mean I can use getElementById, but is there any way to get it at the render time to avoid DOM lookup?
so you could create a component like this:
(defn qr-component
[]
(reagent/create-class
{:reagent-render (fn [] [:div])
:component-did-mount
(fn [this]
(let [element (reagent/dom-node this)]
(js/QRCode. element "")))}))
you could also use a callback ref to initialize the component
(defn qr [] [:div {:ref (fn [node] (when node (js/QRCode. node ...)))))
didn't count the parentheses so YMMV 🙂
yeah it's kind of neat
Is it possible to use re-frame on the server? I would like to have there a single in memory db, too. Then I would like to somehow attach functions to subscriptions which get called whenever the subscription data changes. Could this work?
I like the "data flowing" idea in re-frame. I would like to build the server application the same way. But I am not sure if re-frame is the right tool for it. And I have no idea how to attach a function to a re-frame subscription, so that it gets called whenever the subscription data changes. I also would like to dispatch events instead of changing my state directly.