-
-
Save eyston/89f1d4b883cc1c293dda to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defui Employee | |
static om/Ident | |
(ident [_ {:keys [id]}] | |
[:person/by-id id]) | |
static om/IQuery | |
(query [this] | |
[:id :name]) | |
Object | |
(render [this] | |
;; om/full-query throws | |
;; "No queries exist for component path (om-tutorial.ping/People om-tutorial.ping/Employee) or data path [[:person/by-id 2]]" | |
(println "full-query" (om/full-query this)) | |
(dom/div nil | |
(dom/pre nil (.stringify js/JSON (clj->js (om/props this)) nil 2))))) | |
(def employee (om/factory Employee)) | |
(defui People | |
static om/IQuery | |
(query [this] | |
[{[:person/by-id 2] (om/get-query Employee)}]) | |
Object | |
(render [this] | |
(dom/div nil | |
(employee (-> this om/props (get [:person/by-id 2])))))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; indexer output at that class path | |
#{[[:id :name] | |
{:l [[:person/by-id 2]], | |
:pnodes | |
[[{[:person/by-id 2] [:id :name]}] | |
{[:person/by-id 2] [:id :name]} | |
[[:person/by-id 2] [:id :name]]], | |
:ppath | |
{:l [], | |
:pnodes | |
[[{[:person/by-id 2] [:id :name]}] | |
{[:person/by-id 2] [:id :name]}], | |
:ppath | |
{:l [], | |
:pnodes [[{[:person/by-id 2] [:id :name]}]], | |
:ppath nil, | |
:r nil}, | |
:r nil}, | |
:r nil}]} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment