can anyone help me get this switcher thing to work
@fragamus Line 12
[:tab :main-tab]
?
and I think you've got the order switched, actually
If I remember right, the "type" has to be the first element of the ident, not the second
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 ...}
The first element of the ident is used to select the subquery to use for the element being found in the app db
same rule for singletons
It sucks a little for singletons, cause you'd like to say [:tab :main]
, but you have to instead say [:main :tab]
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.
wow thanks Tony I'll try it out.
Maybe a dumb question — is Om unusable/not worth it without a Clojure/Datomic/EDN backend?
Clojure and Datomic aren’t technically possible backend options in our case with my team’s project.
EDN might be if we can get our backend parser to support it.
we're using SQL on the back-end, and have used Datomic too
see this:
It has a devcard...run the cards build and read the card