Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;; Root query
- static om/IQuery
- (query [this]
- '[{:faces/list (om/get-query Face)}
- {:colors/list (om/get-query Color)}])
- ;; Colors Editor Query (passing the entire props from above to this component)
- static om/IQuery
- (query [this]
- [{:colors/list (om/get-query Color)}])
- ;; Color Ident and Query
- static om/Ident
- (ident [this {:keys [color/name]}]
- [:colors/by-name name])
- static om/IQuery
- (query [this]
- [:db/id :color/name :color/rgb])
- ;; Normalized Data
- {:faces/list [[:faces/by-name :default] [:faces/by-name :comment]],
- :colors/list
- [[:colors/by-name "yellow"]
- [:colors/by-name "blue"]
- [:colors/by-name "red"]
- [:colors/by-name "green"]],
- :colors/by-name
- {"blue" {:db/id 201, :color/name "blue", :color/rgb "#1e90ff"},
- "yellow" {:db/id 200, :color/name "yellow", :color/rgb "#Ffd700"},
- "green" {:db/id 203, :color/name "green", :color/rgb "#2e8b57"},
- "red" {:db/id 202, :color/name "red", :color/rgb "#Cd0000"}},
- :faces/by-name
- {:default
- {:db/id 100,
- :face/name :default,
- :face/background [:colors/by-name "yellow"],
- :face/foreground [:colors/by-name "blue"]},
- :comment
- {:db/id 101,
- :face/name :comment,
- :face/background [:colors/by-name "red"],
- :face/foreground [:colors/by-name "green"]}}}
Add Comment
Please, Sign In to add comment