                (om/build button {:text "Load state"
                                  :click-chan load-state-ch})))))
 
-(defn audio-view [_ owner]
+(defn audio-view [cursor owner]
   (reify
     om/IInitState
     (init-state [_]

                      (map (partial dom/li nil) cursor))))))

(defn button [{:keys [text click-chan]} owner]
  (reify
    om/IInitState
    (init-state [_]
      {:id (new-id)})
    om/IRenderState
    (render-state [_ state]
      (dom/div #js {:id (:id state)}))
    om/IDidMount
    (did-mount [_]
      (let [node (om/get-node owner)
            b (Button. text (.getInstance FlatButtonRenderer))]
        (.render b node)
        (gevents/listen b Component.EventType.ACTION
                        #(go (>! click-chan true)))))))

(defn hive-view [{:keys [cursor save-state-ch load-state-ch]}]
  (reify

               (om/build hive-view {:cursor (:hive cursor)
                                    :save-state-ch (:save-state-ch state)
                                    :load-state-ch (:load-state-ch state)})
               (om/build audio-view (:audio cursor))
               (om/build grid-view {:id "root" :beat-cursors (:beat-cursors cursor)} {:state state})
               (om/build console-view (:console cursor))))))

