My paint function is basically

(defn paint [ctx requests]
  (let [response (chan)]
    (put! requests [:a :custom :request response])
    (go
      (let [r (<! response)]
        :now-paint-the-pixels))))

My inner loop is inside a go block simply because that's where the code landed. 
It wasn't essential that it be inside a go block. But it wasn't wrong, either. 
It's just where the code made sense, because my paint function happens to 
consume a channel.

In case you're wondering, this canvas is a pixel-analyzing component. It's 
layered in front of another canvas and examines its pixels on mousemove. That's 
why my paint function consumes a channel -- it requests ImageData from the 
other component via a channel-based API.

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/clojurescript.

Reply via email to