Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defui Sections
- static om/IQueryParams
- (params [this]
- {:pouchq {}})
- static om/IQuery
- (query [this]
- '({:learn/sections [:learn/sections]} ?pouchq))
- Object
- (componentWillUpdate [this next-props _]
- (let [vid-title (get-in next-props [:learn/active :video :title])
- base-sec (str "section_" vid-title "_")
- new-params {:pouchq {:startkey base-sec
- :endkey (str base-sec "\uffff")
- :include_docs true}}]
- (om/update-query! this (fn [{:keys [query params] :as q}]
- (assoc q :params new-params))
- (render [this]
- (dom/div nil "hey there")))
- (def sections (om/factory Sections))
- (defui ActiveLearn
- static om/IQueryParams
- (params [this]
- {:pouchq {:startkey "active-data"
- :endkey "active-data"
- :include_docs true}})
- static om/IQuery
- (query [this]
- '({:learn/active [:learn/active]} ?pouchq))
- Object
- (render [this]
- (dom/div nil "hey there")))
- (def active-learn (om/factory ActiveLearn))
- (defui View
- static om/IQuery
- (query [this]
- [:app/learn (om/get-query ActiveLearn)
- (om/get-query Sections)])
- Object
- (render [this]
- (dom/div nil)
- (sections (om/props this))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement