Skip to content

Instantly share code, notes, and snippets.

@txus
Created December 15, 2015 14:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save txus/4b421085c2c922dbc687 to your computer and use it in GitHub Desktop.
Save txus/4b421085c2c922dbc687 to your computer and use it in GitHub Desktop.
(defui UserView
static om/Ident
(ident [this {:keys [user/id]}]
[:user/by-id id])
static om/IQuery
(query [this]
'[:user/id :user/name :user/authenticated]))
(defui UserProfilesView
static om/IQuery
(query [this]
[{:app/users (om/get-query UserView)}]))
(defui RootView
static om/IQuery
(query [this]
`[{:root
[~@(om/get-query UserProfilesView)]}]))
(def init-data
{:root
{:app/users
[{:user/name "guest" :user/id :guest}]}})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment