Skip to content

Instantly share code, notes, and snippets.

@jdkealy
Created January 18, 2017 16:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jdkealy/b74e35083aad38428b2587d182bd6144 to your computer and use it in GitHub Desktop.
Save jdkealy/b74e35083aad38428b2587d182bd6144 to your computer and use it in GitHub Desktop.
(let [c (chan)]
(go
(let [func (fn [] (>! c "callback"))]
(.toDataUrl js/window img (fn [res]
(swap! items #(conj % [res name]))
(swap! zips-atom #(-> %
(assoc-in [(:db/id item) :downloaded] (count @items))))
(func)
(do-zip))))
(let [res (<! c)]
(println res))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment