Skip to content

Instantly share code, notes, and snippets.

@IwanKaramazow
Last active January 6, 2016 21:56
Show Gist options
  • Save IwanKaramazow/7278508a84459028b1a3 to your computer and use it in GitHub Desktop.
Save IwanKaramazow/7278508a84459028b1a3 to your computer and use it in GitHub Desktop.
Om next Rootquery
;; wrong RootQuery
(defui RootView
static om/IQueryParams
(params [this]
{:year (om/get-query Year)
:yearTitle (om/get-query YearTitle)
:resultQuery (om/get-query ResultList) ;; here I 'stole' the full query from ResultList, doesn't work
:selected 2015})
static om/IQuery
(query [this]
'[{:th/years ?year} ?resultQuery {:year/current ?yearTitle}]) ;; ?resultQuery is the problem
;; expects a map, should be {:th/results [params..]}
;; working
(defui RootView
static om/IQueryParams
(params [this]
{:year (om/get-query Year)
:yearTitle (om/get-query YearTitle)
:person (om/get-query PersonThResult)
:selected 2015})
static om/IQuery
(query [this]
'[{:th/years ?year} ({:th/results ?person} {:year ?selected}) {:year/current ?yearTitle}])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment