This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-08-19
Channels
- # admin-announcements (2)
- # beginners (25)
- # boot (93)
- # cider (2)
- # clara (2)
- # cljs-dev (63)
- # cljsjs (3)
- # cljsrn (38)
- # clojure (142)
- # clojure-austin (1)
- # clojure-brasil (2)
- # clojure-czech (1)
- # clojure-dev (7)
- # clojure-greece (1)
- # clojure-russia (170)
- # clojure-spec (11)
- # clojure-uk (65)
- # clojurescript (46)
- # clojurex (1)
- # code-reviews (3)
- # cursive (11)
- # datomic (35)
- # euroclojure (6)
- # events (2)
- # flambo (2)
- # hoplon (115)
- # instaparse (11)
- # jobs (21)
- # jobs-rus (3)
- # lambdaisland (2)
- # off-topic (17)
- # om (35)
- # onyx (161)
- # planck (1)
- # protorepl (7)
- # random (1)
- # re-frame (31)
- # reagent (19)
- # ring-swagger (21)
- # rum (5)
- # spacemacs (3)
- # specter (25)
- # test-check (20)
- # testing (7)
- # untangled (2)
- # yada (50)
@ethangracer what's wrong with wrapping recharts in an OM object
pretty much, yeah
nothing wrong with it, just tedious if you want to do it for a large number of components
also @jasonjckn can’t use om/factory
on non-om components
which makes me wonder if rendering a non-om component from a non-om factory would cause issues (indexer, reconciler, etc.)
(defn react-to-om [react query ident] (om/ui IQuery (query [] query) Ident (ident [] ident) Object (render [] react )
hadn’t seen that function before
interesting
@anmonteiro: thoughts? ^^^
(defmacro ui [q & forms]
{:pre [(or (map? q) (vector? q) (list? q))]}
`(let [factory-fn# (atom nil)
new-ui# (om.next/ui
~'static cljs.core/IDeref
(~'-deref [this#]
@factory-fn#)
~'static om.next/IQuery
(~'query [this#]
~q)
~@forms)]
(reset! factory-fn#
(om.next/factory new-ui# {:keyfn admin.util/uid-gen}))
new-ui#))
interesting, I like that
@ethangracer I suppose that would work for the simplest case
However I fail to see a solution for e.g. children
How do you all typically get the “parent” value when implementing a field? For instance my friends-list
would typically depend on the user in question.
if anyone is familiar with the graphql way, it would be like this:
new GraphQLObjectType({
name: 'MyType',
fields: {
myField: {
type: GraphQLString,
resolve(parentValue, args, session) {
// use `session` here
}
}
}
});
parentValue is passed to resolve
@dankweaver Links would be the way to go https://github.com/omcljs/om/wiki/Thinking-With-Links%21
thank you so much
however it’s a bit of a different concept
it’s not really accessing the parent per se
but something that is “global” to the application
i.e. a top level property in your app state
hmm how does this work on remotes tho.. there wouldn’t be enough context would there?
links aren’t supposed to be sent to remotes
in my experience, you’d have :foo
in a top-level query and send that to the remote
once it’s fetched, queries down in the component tree can have foo with [:foo _]
thank you.. this makes sense
implicit arguments like current user I suppose would just be in the env
that is passed to read