             [om-tools.core :refer-macros [defcomponent defcomponentk]]))
 
 (enable-console-print!)
+
 
 (defonce app-state (atom {:text "Hello Chestnut!"}))
 

  [pair]
  (get-in pair [1]))


(defcomponent cell [data owner {:keys [pos]}]
  (init-state [_]
              {:clicked false})
  (render-state [this {:keys [info]}]
          (dom/td #js {:className "cell"
                       :id (if (= true (om/get-state owner :clicked))
                             "light-blue"

    (init-state [_]
      {:x-cell (range 3), :y-cell (range 3)})
    (render-state [_ state]
                  (if (:fun-chan state)
                    (js/console.log "yolo")
                    (js/console.log "hehe"))
      (apply dom/table #js {:id "chess-board"}
        (for [y (:x-cell state)]
          (apply dom/tr nil
                 (for [x (:y-cell state)]
                   (om/build cell (cell-col x y)
                             {:opts {:pos [x y]}
                              :init-state {:info (:info state) :fun-chan (when (and (= 0 y)(= 0 x))(:fun-chan state))}})))))))

(defcomponent main-view
  [data owner]
  (init-state [_]
    {:info (chan)
     :fun-chan     (chan)
     :pub-chan     (chan)})

  (will-mount [_]
      (let [info (om/get-state owner :info)
            fun-chan (om/get-state owner :fun-chan)]
        (go (loop []
              (let [pos (<! info)]
                (js/console.log "the cords are " (x-cord pos) ", " (y-cord pos))
                (om/set-state! owner :pos pos)
                (js/console.log "the cur pos is" (om/get-state owner :pos))
                (put! fun-chan pos)
                (recur))))))

  (render-state [_ {:keys [info fun-chan]}]
                (when info
                  (js/console.log "info tnsieraotn"))
    (dom/div nil
        (dom/h1 nil "lol world")
        (om/build board nil {:init-state {:info info}})
        (om/build board nil {:init-state {:info info :fun-chan fun-chan}})
        (om/build board nil {:init-state {:info info :fun-chan fun-chan}})
        (dom/button #js {:onClick #(js/console.log "yo")} "click me"))))

(defcomponent my-test
  [data owner]
