Fork me on GitHub
#untangled
<
2016-12-16
>
fragamus20:12:37

can anyone help me get this switcher thing to work

tony.kay21:12:48

[:tab :main-tab]?

tony.kay21:12:19

and I think you've got the order switched, actually

tony.kay21:12:33

If I remember right, the "type" has to be the first element of the ident, not the second

tony.kay21:12:50

Think of the to-many union case: you might have a list of idents like this: [ [:image 1] [:comment 2] [:link 3] ] to render out a list of things (an image, comment, and link). The union query would be {:image (om/get-query Image) :comment ...}

tony.kay21:12:14

The first element of the ident is used to select the subquery to use for the element being found in the app db

tony.kay21:12:19

same rule for singletons

tony.kay21:12:45

It sucks a little for singletons, cause you'd like to say [:tab :main], but you have to instead say [:main :tab]

tony.kay21:12:37

might also help to remember that the second element of a thing is the ID, and there is only one of those for singletons...what if it were a number (which it can be): [:main 0], [:main :only-one], etc.

fragamus21:12:48

wow thanks Tony I'll try it out.

keatondunsford23:12:07

Maybe a dumb question — is Om unusable/not worth it without a Clojure/Datomic/EDN backend?

keatondunsford23:12:27

Clojure and Datomic aren’t technically possible backend options in our case with my team’s project.

keatondunsford23:12:54

EDN might be if we can get our backend parser to support it.

tony.kay23:12:59

we're using SQL on the back-end, and have used Datomic too

tony.kay23:12:29

It has a devcard...run the cards build and read the card