This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-01-09
Channels
- # admin-announcements (40)
- # beginners (6)
- # boot (69)
- # braid-chat (43)
- # business (3)
- # cljsrn (99)
- # clojure (51)
- # clojure-art (2)
- # clojure-brasil (2)
- # clojure-dev (23)
- # clojure-portugal (1)
- # clojure-russia (15)
- # clojurescript (52)
- # community-development (319)
- # core-async (1)
- # cursive (40)
- # datomic (6)
- # editors (11)
- # emacs (1)
- # hoplon (20)
- # jobs (1)
- # ldnclj (5)
- # leiningen (2)
- # mount (5)
- # off-topic (1)
- # om (45)
- # proton (5)
- # re-frame (29)
- # reagent (4)
- # ring-swagger (1)
- # yada (6)
Hey everyone! om.next question about nested components -- other components don't update unless explicit :count is set in om/transact!, despite having [:count] in component query. I'd expect it to update regardless. What am I doing wrong? https://gist.github.com/featheredtoast/7030fbeb673d35cc23e6
...followed https://github.com/omcljs/om/wiki/Om-Next-FAQ#why-is-my-component-not-rerendered-after-transact but keys are present in the query.
@featheredtoast: your root component should compose all child queries and then pass that information to them via it’s props (looks like you are passing the deref’d state to it directly….More complex example but this shows what I mean about root component composing all child queries: https://github.com/omcljs/om/wiki/Queries-With-Unions
ah, thanks so much
@anmonteiro: I try using your template, if I understand correctly we would navigate by
{:on-click #(om/transact! this
'[(navigate! {:navigation-point :project-page})])}
?@nxqd: not quite; it depends
if that's an anchor tag you actually just need to add a route for its href
in routes.cljs
and add a navigation handler in controllers/navigation.cljs
if that's a button or something, look at the function send-nav!
in routes.cljs
the navigate!
mutation is an internal thing and should only be called from the navigation controller
Today I've learnt that when reading one key with get-in I can get into a trap because if the key is nil get-in will return all state content, so I need to protect this https://gist.github.com/geraldodev/f926685132e306663487#file-read_form_cliente-clj-L11 Another thing is if the this read result in a nil I got to return an empty map in order to update the component properties, if it returns nil the component properties will not be updated.
my Om app freezes when its update function assocs a thing with an infinite seq (assoc state :thing (repeat 0)), but not if it's (assoc state :thing (repeat 64 0)) -- huh ?
(using om/transact! state ...)
@octo221: Om only supports maps & vectors as state entries
@anmonteiro: oh right...why ?
I’m learning Om Next. So, in if an app tends to have only one reconciler, does it also mean only one parser and thus only one read and one mutate function (or multimethod of course)?
@pupeno: that depends, I usually have a few parsers, I use Tony Kay library so for starters I use 1 parser for local, one extra for remote detection, I also use another level of parser at my remote (I'm working with indexeddb, so I make a parser that target that and I use it at the send
method), so it may have multiple parsers or not, up to you
how do you have more than one parser with one reconciler?
your parser is responsible for the composition, it's not an Om.next feature directly
had you done the om.tutorial from Tony Kay?
ok, that's good
and a few more pages in the wiki there.
I recommend you try this one as well: https://awkay.github.io/om-tutorial/
there he uses some custom parsing code, it is a nice place to look for in order to implement custom parsers
Thanks. I’ll do.
@hugod: that's just a React thing
@anmonteiro: I thought om required some global state (e.g. *reconciler*
) to be set when rendering
@hugod: I'm not sure what you're trying to say
@hugod: forceUpdate
forces a component to re-render, is this not what you want?
@sander: I've written a lein-template that uses that approach to routing
@anmonteiro: thanks!
@anmonteiro: I’ll give it a try. Thanks.
@hugod: Om itself uses this. see https://github.com/omcljs/om/blob/master/src/main/om/next.cljs#L741
@anmonteiro: om or om/next?
I’m trying to use the ReactNative Navigator, but when I push a component to it in an :onPress
function, I get Error: Assert failed: (reconciler? reconciler)
. I can capture *reconciler*
in my render method, and rebind it in the :onPress
function, but then other things seem to break. I imagine I must be doing something wrong.
just wrote part 2 of my "Exploration of Object Recursion Design Patterns with Om Next Recursive Queries"; this time I talk about the Decorator read if you're interested https://twitter.com/anmonteiro90/status/685955953037029376
@hugod: you may also want to check the #C0E1SN0NM channel - several people there working with om.next
Hi. I'm going through https://github.com/omcljs/om/wiki/Intermediate-Tutorial#modularity and when trying to add [om-sync "0.1.1"]
I've got this: http://dpaste.com/23YFZZ9
What can be reason for such strange problem?
Would om-sync
be deprecated soon with development of Om Next?