Fork me on GitHub
#om
<
2016-01-09
>
featheredtoast00:01:34

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

adammiller00:01:50

@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

featheredtoast01:01:39

ah, thanks so much simple_smile

jimmy08:01:51

@anmonteiro: I try using your template, if I understand correctly we would navigate by

{:on-click #(om/transact! this
                                '[(navigate! {:navigation-point :project-page})])}
?

anmonteiro12:01:37

@nxqd: not quite; it depends

anmonteiro12:01:43

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

anmonteiro12:01:58

if that's a button or something, look at the function send-nav! in routes.cljs

anmonteiro12:01:31

the navigate! mutation is an internal thing and should only be called from the navigation controller

geraldodev12:01:13

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.

octahedrion14:01:09

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 ?

octahedrion14:01:48

(using om/transact! state ...)

anmonteiro14:01:06

@octo221: Om only supports maps & vectors as state entries

pupeno17:01:54

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)?

wilkerlucio18:01:56

@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

pupeno18:01:40

how do you have more than one parser with one reconciler?

wilkerlucio18:01:22

your parser is responsible for the composition, it's not an Om.next feature directly

wilkerlucio18:01:34

had you done the om.tutorial from Tony Kay?

wilkerlucio18:01:56

ok, that's good simple_smile

pupeno18:01:56

and a few more pages in the wiki there.

wilkerlucio18:01:07

I recommend you try this one as well: https://awkay.github.io/om-tutorial/

wilkerlucio18:01:39

there he uses some custom parsing code, it is a nice place to look for in order to implement custom parsers

pupeno18:01:43

Thanks. I’ll do.

hugod21:01:52

Is it possible to force a component to render in om.next?

anmonteiro21:01:38

@hugod: that's just a React thing

hugod21:01:04

@anmonteiro: I thought om required some global state (e.g. *reconciler*) to be set when rendering

sander21:01:13

are there examples online of om next apps using set-query! for routing?

anmonteiro21:01:07

@hugod: I'm not sure what you're trying to say

anmonteiro21:01:29

@hugod: forceUpdate forces a component to re-render, is this not what you want?

anmonteiro21:01:02

@sander: I've written a lein-template that uses that approach to routing

hugod21:01:08

@anmonteiro: I’ll give it a try. Thanks.

esnunes22:01:14

sorry I just checked out, it supports both 😉

hugod22:01:32

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.

anmonteiro22:01:24

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 simple_smile https://twitter.com/anmonteiro90/status/685955953037029376

donmullen23:01:40

@hugod: you may also want to check the #C0E1SN0NM channel - several people there working with om.next

andrewboltachev23:01:41

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

andrewboltachev23:01:02

What can be reason for such strange problem?

andrewboltachev23:01:31

Would om-sync be deprecated soon with development of Om Next?