om-next

joseph 2016-09-17T10:58:41.000119Z

@mitchelkuijpers hi, i have added the query on the transact!, and add the function to display the message in the shouldComponentUpdate to see if all the related components are updated. but it does not work, only the component which sent the transact updates and printout the message

mitchelkuijpers 2016-09-17T11:26:06.000120Z

Could you show me your transact! call?

joseph 2016-09-17T22:15:13.000121Z

yes, this is the component

joseph 2016-09-17T22:16:56.000125Z

(defui RoundDropDown
  static om/IQuery
  (query
   [_]
   [:rounds :selected-round :update-sidebar-dropdowns :loading])
  Object
  ;; get rounds when loading this component
  (shouldComponentUpdate
    [this next-props next-state]
    (helpers/d "round next props" )
    (not= next-props (om/props this)))
  (render
   [this]
   (let [{:keys [rounds selected-round update-sidebar-dropdowns loading]} (om/props this)
         round (first (filter #(= (:id %) selected-round) rounds))]
     (dom/div #js {:className "panel panel__form-rounds"}
              (dom/div #js {:className "panel__form-button"}
                       (dom/button #js {:className "button"
                                        :onClick #(om/transact!
                                                    this
                                                    `[(form-sidebar/set-dropdown
                                                        {:dropdown-item :rounds})
                                                      :update-sidebar-dropdowns])}
                                   (str (or (:label round) "Select round")
                                        " ")
                                   (dom/span #js {:className "caret"})))))))

joseph 2016-09-17T22:17:26.000126Z

the transact is triggered in the click event

#(om/transact!
                                                    this
                                                    `[(form-sidebar/set-dropdown
                                                        {:dropdown-item :rounds})
                                                      :update-sidebar-dropdowns])

joseph 2016-09-17T22:18:17.000127Z

and the component contains the query :update-sidebar-dropdown