   [_ form-value _]
   form-value)
 
+(defmethod produce-maze-value :anim-chan
+  [_ form-value _]
+  form-value)
+
 (defmethod produce-maze-value :grid
   [_ new-value {:keys [maze] :as state}]
   (let [{:keys [algorithm rows columns grid]} maze]

(defui MazeDisplay
  static om/IQuery
  (query [this]
    '[{:maze [:grid :rows :columns :cell-size :algorithm :active]}])
  Object
  (componentDidMount [this]
    (println "componentDidMount called.")
    (let [{:keys [grid cell-size sync-chan] :as maze} (om/props this)
          c @thecanvas
          g (.getContext c "2d")]
      (image/image-grid g @grid cell-size)
      ; (go (when sync-chan (async/>! sync-chan true)))
      ))
  (componentDidUpdate [this prev-props prev-state]
    (println "componentDidUpdate called.")
    (let [{:keys [grid cell-size sync-chan] :as maze} (om/props this)
          c @thecanvas
          g (.getContext c "2d")]
      (image/image-grid g @grid cell-size)
      ; (go (when sync-chan (async/>! sync-chan true)))
      ))
  (render [this]
    (let [{:keys [grid rows columns algorithm cell-size active] :as maze} (om/props this)]

                 (let [grid (assoc grid :path {:distances distances
                                               :color-family :red})]
                   (set-maze-params! :grid (atom grid))
                   (async/<! (sync-chan anim-chan))
                   (recur grid)))
               grid))))

