This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-09-14
Channels
- # aleph (1)
- # aws-lambda (10)
- # beginners (161)
- # bitcoin (2)
- # boot (20)
- # cider (3)
- # clara (46)
- # cljs-dev (35)
- # cljsrn (9)
- # clojure (123)
- # clojure-boston (1)
- # clojure-colombia (1)
- # clojure-dusseldorf (3)
- # clojure-gamedev (2)
- # clojure-germany (2)
- # clojure-greece (1)
- # clojure-italy (7)
- # clojure-losangeles (3)
- # clojure-nl (2)
- # clojure-russia (15)
- # clojure-spec (1)
- # clojure-uk (7)
- # clojurescript (75)
- # community-development (5)
- # cursive (5)
- # datomic (25)
- # docs (3)
- # emacs (1)
- # fulcro (11)
- # graphql (131)
- # heroku (1)
- # jobs (1)
- # juxt (55)
- # lein-figwheel (2)
- # luminus (1)
- # off-topic (4)
- # om (8)
- # onyx (32)
- # pedestal (19)
- # re-frame (53)
- # reagent (11)
- # remote-jobs (1)
- # rum (12)
- # shadow-cljs (12)
- # spacemacs (53)
- # testing (2)
- # unrepl (18)
hi, I'm a newbie. I don't know what the Om component
means in om/component?
(defui HelloWorld
Object
(render [this]
(dom/div nil "Hello, world!")))
(def hello (om/factory HelloWorld))
I tried:
(om/component? HelloWorld)
(om/component? hello)
Both commands returned false
@minhnh om/component?
actually checks for a component instance. For example,
(defui HelloWorld
Object
(render [this]
(println (om/component? this))
(dom/div nil "Hello, world!")))
;; true
If you’re using the repl, you can go (om/component? (om/class->any reconciler HelloWorld))
om/class->any
asks the reconciler for some instance (if there are several instances, it’ll return one of them) of the HelloWorld
class.
If you’re looking for a specific instance,
(om/component? (om/ref->any reconciler [:something/by-id 0]))
, where [:something/by-id 0]
is an ident
you’re welcome. ref->any can do more, but I’ll just leave this here for brevity. https://github.com/omcljs/om/wiki/Documentation-(om.next)#ref-any