                 (cb (.-response xhr)))))
       (.send))))
 
-(defn cb->chan
-  "Convert a callback function "
-  [ cb-fn ]
-  (let [ret-chan (chan )]
-    (do
-      (->>
-        (fn [ret-val] (put-close! ret-chan ret-val))
-        (cb-fn))
-      ret-chan))
-  )
+;; }}}
 
 ;; =============================================================================
-;; Crappy stab at seperating out loading into a channel
+;; {{{ Crappy stab at seperating out loading into a channel
 (defprotocol ILoader
   (load-blob! [_ file-name]))
 

          )
          ret-chan 
        ))))

;; =============================================================================
;; todo

            [dommy.core             :as dommy :include-macros true]    
            [hipo.core              :as hipo  :include-macros true]))

;; =============================================================================
;; {{{ Misc TODO move into utils file
(defn put-close! [ch v]
  (do
    (async/put! ch v)
    (async/close! ch)))

(defn cb->chan
  "Convert a callback function "
  [ cb-fn ]
  (let [ret-chan (chan )]
    (do
      (->>
        (fn [ret-val] (put-close! ret-chan ret-val))
        (cb-fn))
      ret-chan)))

;; }}}

;; =============================================================================
;; {{{ Multi method to turn a blob into an element
(defn img->iimage [img]
  (reify
    rp/IImage
