Skip to content

Instantly share code, notes, and snippets.

@brianium
Created December 22, 2016 17:50
Show Gist options
  • Save brianium/19b7c16271d28a8fdb211cc74637059a to your computer and use it in GitHub Desktop.
Save brianium/19b7c16271d28a8fdb211cc74637059a to your computer and use it in GitHub Desktop.
(def i (js/Image.))
(def p (js/Promise. (fn [resolve]
(set! (.-onload i) #(resolve i))
(set! (.-src i) "url.jpg"))))
(.then p (.-log js/console))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment