-
-
Save Sose/c20a64b64b64b47fde7183e4932b9885 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn start-playing-turtle! [] | |
(let [start-playing (get-in @state/app-state [:turtle :playing])] | |
(if start-playing | |
(let [interval-id (js/setInterval turtle-step! 1000)] | |
(swap! state/app-state assoc-in [:turtle :playing-id interval-id])) | |
(let [interval-id (get-in @state/app-state [:turtle :playing-id])] | |
(js/console.log (str interval-id)) | |
(js/clearInterval interval-id) | |
(swap! state/app-state assoc-in [:turtle :playing-id] nil))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment