This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-09-27
Channels
- # arachne (1)
- # beginners (31)
- # boot (84)
- # cider (9)
- # clara (2)
- # cljs-dev (102)
- # cljsrn (20)
- # clojure (254)
- # clojure-belgium (1)
- # clojure-dusseldorf (17)
- # clojure-greece (7)
- # clojure-italy (6)
- # clojure-russia (2)
- # clojure-spec (8)
- # clojure-uk (9)
- # clojurescript (93)
- # component (4)
- # copenhagen-clojurians (1)
- # cursive (24)
- # datomic (22)
- # editors (1)
- # emacs (8)
- # garden (2)
- # hoplon (357)
- # lein-figwheel (1)
- # leiningen (4)
- # luminus (27)
- # mount (13)
- # off-topic (7)
- # om (71)
- # onyx (35)
- # planck (3)
- # re-frame (53)
- # reagent (35)
- # ring-swagger (24)
- # specter (10)
- # sql (6)
- # untangled (47)
- # vim (157)
hey guys - is there a way to set a static property on an om.next component defined via (defui ... ) ?
testing out this React Native library https://github.com/exponentjs/ex-navigation
Are there any examples using om.next with other than datomic back-end? I imagine one has to adapt reads/mutations and basically translate queries?
Feels a bit overwhelming if you’ve never used either datomic or om.next before and having to learn both at once, I’d like to try a db I’ve used before.
FWIW the tutorials seem very good though, went through a couple and was able to get up and running with simple apps like AnimalsList etc.
@raspasov Have you tried just putting in there? @anmonteiro just added a fix that allowed arbitrary static protocols to be added to a defui class.
oh wait, hmm… props...
okay scratch what I said
@levitanong yea : ) but thanks
(defui MyComponent
static field foo 42)
@levitanong https://github.com/omcljs/om/pull/790 <- looks good to me
but if you want that to be merged, you must ask @dnolen to sign a CA
unless you’ve done it already?
@anmonteiro Sent him an email 🙂 Awaiting his reply
I do hope it hasn’t been sent to his spam folder
gotcha
I wonder if https://github.com/omcljs/om/wiki/Contributing shouldn’t be in the root of repo
how so?
in a CONTRIBUTING.md
or something
would probably be easier for people to find it
i personally don’t find a problem with it being in the readme
though I can see why other people would look for it in CONTRIBUTING.md
oh it is in the README?
well not really
it’s not the same information
LOL okay I only just found the wiki entry now
^ I rest my case
js->om question.
this.refs.item.focus() = (.focus (.-item (om/react-ref this :some-ref)))
?
@hlolli should probably be: (.focus (om/react-ref this “item”) )
yes, when its a string this works, at least now I have a new error message that is out of the scope of om
this.input.getInputNode is not a function material-ui.inc.js:27365
thanks, for this!
Suppose my component needs to render a subcomponent which will render the current user. My component queries for [{:app/current-user (om/get-query User)}]
and renders (user (:app/current-user (om/props this)))
.
Now suppose my component also needs to show the name of the current user elsewhere in its UI. How do I query for both? I don't believe I can just query for [{:app/current-user (om/get-query User)} {:app/current-user [:user/name]}]
. That appears to just use the second join.
@peeja why isn’t putting :user/name
in the query of User
an option?
@peeja so (into (om/get-query User) [:user/name ])
should work
you just need to be careful to keep the query metadata
which is why I didn’t write (into [])
I assume I'll run into trouble if I have two components that need to render the :app/current-user
from here
Something like [{[:app/current-user :as ::user-for-subcomponent] (om/get-query User)} {:app/current-user [:user/name]}]
@peeja nothing stopping you from giving another name to the join?
maybe I don’t understand your use case
I want to tell the parser, "Read :app/current-user
, but return it to me as ::user-for-subcomponent
"
Just as you don't need to permanently alias tables in a SQL database to give a table an alias within a query
@peeja I really might not be getting your use case, but that’s also something you can do in the parser
“parse this query here, put the result that’s under :foo
in the response under :bar
in my result"
if it’s a top-level property probably not
i.e. you probably can’t do what I said
if it’s not you can use recursive parsing
@anmonteiro If I just into
it, I'll lose the additions if my subcomponent set-query!
s, right?
@anmonteiro ah thank you!
@anmonteiro I was trying to read the defui macro code but couldn't quite get that part within 15-20 minutes, thanks again! : )