Fork me on GitHub
#om
<
2015-10-24
>
thosmos00:10:41

@dnolen in the remote sync tutorial, this is throwing an error: (p {:state app-state} (om/get-query Dashboard) :static) [Error Error: No item 1 in vector of length 1]

dnolen00:10:07

@thosmos: can’t reproduce that here

dnolen00:10:23

hrm actually I can if I start fresh looking

dnolen00:10:35

@thosmos found it typo thanks

dnolen00:10:36

@thosmos pushed was extra wrapping very in the read multimethod

thosmos00:10:32

that works, thanks!

dnolen11:10:47

@thosmos: that’s a very cool use case

thomasdeutsch12:10:38

Can anyone help me? I would like to render ItemOne <OR> ItemTwo, based on the ":selected" ref of entity 0. https://gist.github.com/ThomasDeutsch/ec80942bca3270013032

thomasdeutsch12:10:04

will get this error: "No queries exist for component path (scheduler.main.core/Root scheduler.main.core/ItemTwo)"

thomasdeutsch12:10:23

when i try to switch items

dnolen12:10:13

@thomasdeutsch: just a bug, file an issue - we need to update the index if a new kind of component mounts

thomasdeutsch12:10:29

yes, i will file an issue

sander13:10:08

i've copy-pasted the code from https://github.com/omcljs/om/wiki/Queries-With-Unions up until Normalization, and (om/get-query Dashboard) gives the expected result but (om/normalize Dashboard init-data true) gives:

{:dashboard/items [[nil nil] [nil nil] [nil nil] [nil nil] [nil nil]],
 nil {nil {}}}
i'm using the same deps as in Quick Start (i.e. alpha7, same figwheel, no devcards, etc), except that [datascript "0.13.1"] is also in (used in a different ns). When debugging, it seems that DashboardItem’s ident gets an empty map as props.

dnolen13:10:31

@sander: just tried it works for me

sander13:10:55

@dnolen: thanks for checking, i'll try again in a fresh installation then

sander13:10:12

yes, works there, i may have messed something up from within a different namespace or something

sander13:10:00

small typo in https://github.com/omcljs/om/wiki/Queries-With-Unions under The Queries: (in-ns 'om.tutorial) should be (in-ns 'om-tutorial.core)

dnolen13:10:20

fixed thanks

anmonteiro13:10:40

@dnolen typo in union tutorial

anmonteiro13:10:47

in Photo render method

anmonteiro13:10:02

where it's (dom/p "Caption: "), it should read (dom/p nil "Caption: ")

drcode19:10:56

Hi, still have some confusion around params: Do the "params" of iQueryParams have anything to do with the concept of "params" in the parser or are those two separate things?

drcode19:10:14

To give a concrete problem I'm trying to solve with params: I have a child that is a "dumb" list component, so I want it's parent to somehow tell it "here's the query selector you need to find out what items you need should display", and so it seems like I would specify this in the parent's iQuery result as a param, then the child list would "capture" that in its iQueryParams/iQuery logic to generate the pull in the correct items to display...

drcode19:10:01

...but it seems I must be thinking about it wrong somehow

griffio19:10:40

My understanding is that the IQueryParams is for binding parameters to the Query. The Query is then parsed with whatever is in its params. The docs say this: "This component defines om.next/IQueryParams along with om.next/IQuery. The params method should return a map of bindings. These will be used to replace any occurrences of ?some-var in the actual query."

drcode19:10:00

OK, now that I've written out my question, I think my problem is that I'm thinking of iQuery functions as using "function composition" vis a vis child components. But instead, the correct way of thinking about it is DSL rewriting: If the list manager is "dumb" then the parent component can just rewrite the query selector of the list manager to pull in extra things

drcode19:10:47

...sort of like in the "Query Union" example, the DataItem component rewrites the child query selectors to include ":friends"

drcode19:10:01

@griffio: Yes, I think you are right- iQueryParams and the parser ":params" key are completely unrelated, except that they both embody the abstract notion of a "parameter"

griffio19:10:20

The params in the IQueryParams is a function - so can drive some initial query criteria such as pagination.

drcode19:10:00

OK, I think I need to sleep (am in Europe right now) because I clearly still have some confusion around this - Thanks for the pointers, @griffio!

dnolen20:10:48

Just added om.next/denormalize I got sick of writing manual joins

dnolen20:10:05

in the parser on the client

griffio20:10:25

Yes, some nice yin-yang, complementary functions - just looking at the source.

tony.kay21:10:20

@thosmos: Thanks for that snippet. I didn’t know about specter, and that is very sweet indeed

dnolen22:10:54

just cut Om 1.0.0-alpha8, fixes a subtle union bug found by @thomasdeutsch