Skip to content

Instantly share code, notes, and snippets.

@grav
Last active December 16, 2018 14:07
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 grav/a8bb76f1a6be9566fe2cc320a3bdb2e8 to your computer and use it in GitHub Desktop.
Save grav/a8bb76f1a6be9566fe2cc320a3bdb2e8 to your computer and use it in GitHub Desktop.
(defn sleep [s]
(js/Promise. (fn [res rej]
(js/setTimeout res (* 1000 s)))))
(defn start []
(println "while start")
(-> (sleep 2)
(.then start)))
(start)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment