Skip to content

Instantly share code, notes, and snippets.

@jasonneylon
Created August 11, 2017 09:38
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 jasonneylon/869a2e81ae457a52af285ade237324ae to your computer and use it in GitHub Desktop.
Save jasonneylon/869a2e81ae457a52af285ade237324ae to your computer and use it in GitHub Desktop.
(defn timeout [ms]
(let [c (chan)]
(js/setTimeout (fn [] (close! c)) ms)
c))
(defn run-kmean
[]
(go
(dotimes [iteration 10]
(<! (timeout 1000))
(swap! app-state update-kmean)
...
)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment