     app
     app-state
     {:target (. js/document (getElementById "app"))
-     :shared {:pick-channel (chan)
+     :shared {:pick-channel  (chan)
               :ticket-fields dummy-ticket-fields}}))
 
 

      (conj cleaned-conditions new-condition)
      cleaned-conditions)))


(defcomponent app [app-state owner]
  (will-mount [_]
    (let [{:keys [pick-channel]} (om/get-shared owner)]
      (go-loop []
        ; handle updates from the three picker components
        (let [{:keys [selection-to-update new-value]} (<! pick-channel)]
          (om/update! app-state [:selections selection-to-update] new-value)

          (case selection-to-update
            :master-field (put! pick-channel {:selection-to-update :field-value
                                              :new-value           nil})
            :field-value (put! pick-channel {:selection-to-update :slave-fields
                                             :new-value           #{}})
            :slave-fields (let [{:keys [master-field field-value] :as selections} (:selections @app-state)
                                conditions (:conditions @app-state)
                                master-and-value-selected? (every? (comp not nil?) [master-field field-value])]
                            (when master-and-value-selected?
                              (let [updated-conditions (update-conditions conditions selections)]
                                (om/update! app-state [:conditions] updated-conditions))))))
        (recur))))
  (render-state [_ {:keys [selected-field-id slave-fields-picker-chan
                           selected-value]}]
    (html
      [:section.ember-view.apps.app-554.apps_nav_bar.app_pane.main_panes
       [:header
        [:h3 "Conditional Fields"]]

       [:div.cfa_navbar
        {:data-main 1}

              [:td.selected
               [:div.values
                [:div.separator "Available"]
                (om/build slave-fields-picker (:selections app-state))]]]]]]]
         ]

        [:footer
         [:div.pane
          [:div
           (prn-str (clj->js (:selections app-state)))]
          [:button.delete.text-error.deleteAll
           {:style {:display :none}}
           "Delete all conditional rules for this form"]
