This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-02-23
Channels
- # admin-announcements (1)
- # announcements (1)
- # beginners (222)
- # boot (210)
- # cider (26)
- # cljs-dev (50)
- # cljsrn (19)
- # clojure (243)
- # clojure-art (12)
- # clojure-finland (1)
- # clojure-poland (43)
- # clojure-russia (46)
- # clojure-sg (13)
- # clojurescript (60)
- # core-async (14)
- # css (11)
- # datomic (9)
- # devcards (9)
- # dirac (2)
- # editors (13)
- # emacs (5)
- # euroclojure (1)
- # events (3)
- # hoplon (76)
- # immutant (10)
- # job (1)
- # jobs (2)
- # keechma (1)
- # ldnclj (33)
- # lein-figwheel (1)
- # leiningen (20)
- # luminus (26)
- # mount (31)
- # om (105)
- # onyx (56)
- # parinfer (29)
- # perun (12)
- # proton (1)
- # re-frame (14)
- # reagent (5)
- # sydney (1)
- # yada (15)
@anmonteiro: thank you, definetely helping me just in time 👍
@anmonteiro: Yup, I was jsut about to clean up my routing logic- Thanks for the post!
@anmonteiro: thanks for great post
Fairly new to Clojurescript/Om (next), is there any good info out there about working with React components in Om next?
does anyone experience the problem that when we use core async mult, and tap channel in componentDidMount
, it works perfectly fine but if the app is being loaded by figwheel, it's being called multiple times until the browser crashes.
@nxqd: no idea, but maybe this helps? (defui ^:once MyComponent)
@marianoguerra: thanks, will try it out
are there are pros/cons to the different routing approaches that people are aware of?
@danielstockton: I found the union queries approach yields very long queries that are harder to read when debugging
interesting, that's the approach i naturally went for
I'm trying to do a remote read but my send function never gets invoked. Also NB: :target
is always nil
in my read functions. Any ideas?
@rauh: are you using the default remote name? if so, are you adding :remote true or :remote ast to the mutate to make it send?
s/mutate/read/
if you aren't using the default remote name then change :remote for the name of your remote
@marianoguerra: Yes I tried both actually. Also tried the default remote name or specifying my own ones. :send
never gets called 😞
can you share some code?
of the read when you create the reconciler and the send function?
@marianoguerra: It's actually all the vanilla code samples from om.next example. I'll try to isolate it further. I thought maybe this was a common problem.
@rauh: you can try this example that uses remotes and is quite simple and tell me if it works https://github.com/marianoguerra-atik/tudu-v1
So the remote read works if I return it at the root query (I call the parser recursivley) but not when returning it in one of the other key-reads. I thought it was as easy as (assoc ast :query-root true)
😞
@rauh: that's expected, see https://github.com/awkay/om-tutorial/blob/master/src/main/om_tutorial/parsing.cljs#L191 for a possible solution
@anmonteiro: In his code, he switches at the very top depending on target
. But why is mine always nil
? The docs say it should be called for each remote, no?
You answered your question :)
The point is that this not an Om related thing at all... It's just how recursion works and people should be aware of that
Any suggestion on how to integrate a plain React component in Om? A guide or something would be much appreciated. I’m trying to use this https://github.com/RubaXa/Sortable (if you have an alternative for a Sortable list in Om please let me know) thanks
@iacopo: there's a sortable here: https://github.com/Jannis/om-mantras
also, integrating a plain React component in Om is no harder than (js/React.createElement your-react-componentt #js {:its :props})
thanks @anmonteiro i’m looking for a sortable that works on mobile too and the one you suggested looks like use draggable instead of touch events. i’ll check it out better anyway.
(defn -input [opts & children](apply js/React.createElement js/ReactBootstrap.Input opts children))
Example of using react bootstrap inputI know slack is the new hotness and all, but I find it really disheartening that history is so limited. Trying to go back to find something from the 16th (a week ago), and it's no longer there 😕
From what I can tell, not even pinned items are available if they're beyond the history cut-off.
Are there some examples out there of custom reconciler merge functions? I don't see any on the wiki or the tony.kay's om-tutorial
@grzm: I used this one for a while (defn custom-merge-tree [a b] (if (map? a) (merge-with into a b) b))
Although that was a couple of Om Next alphas back
For some strange reason it doesn't work anymore 😂
might be my code though
for interested folks, there's a talk on React.js conf right now that'll mention Om Next
I still keep getting "Encountered two children with the same key" 😞 I've tried providing a Ident but this didn't fix my problem and I also saw in the docs that this doesn't aplly if I'm using datascript(which is the case)
I don't understand what "Can optionally supply :keyfn - this should produce the React key property from the component props" in the docs means
I have this in my component: Object (render [this] (let [{:keys [name]} (om/get-computed this)]
I call it like... (tab-link-comp (om/computed (om/props this) {:name "Store"})) (tab-link-comp (om/computed (om/props this) {:name "Skilltree"})))
om.next can set props directly to the component which will I think potentially remove non-query props
@futuro Didn't know I could do this... I thought props were supposed to come from hmm, querying, and anything else I should use computed props
final example: (def tab-link-comp (om/factory TabLink {:keyfn (fn [props] (:name (om/get-computed props)))}))
No problem, I generally have no idea what I'm doing and I'm happy to know that people can understand my questions haha
When you take a look at the 'default db format' map it has two types of entries. At the moment I'm calling them 'by-id entries' and 'non by-id entries'. The by-id entries are where your data tables are. The 'non by id' are are a vector of Idents, or in some cases just one Ident. Examples:
I'm looking for a better way of referring to these two types of entries. Than 'by id entries' or 'non by id entries'.
I've written a small library with a check
function that checks if your state is in 'default db format'. So looking to name things (even internal things) a bit better.
@cjmurphy: "Om Next tables" might be a good name
it's what Om puts into the state on normalization: https://github.com/omcljs/om/blob/master/src/main/om/next.cljs#L1255
Good yes. And the 'non-ids', which are just a vector of Idents normally. Maybe 'refs' - because that's what they are - a list of references.
refs are what's in the om next tables..