Skip to content

Instantly share code, notes, and snippets.

@colonelrascals
Created August 28, 2018 21:54
Show Gist options
  • Save colonelrascals/4eeb074a2d33f7b2dde6fd300e44583c to your computer and use it in GitHub Desktop.
Save colonelrascals/4eeb074a2d33f7b2dde6fd300e44583c to your computer and use it in GitHub Desktop.
(defn- pos-volume
[num]
(if (pos? num) num 0))
(defn- click-volume-down-btn
"Turn it down you kids!"
[js-evt]
(let [new-volume (- js-evt 1)]
(swap! *app-state assoc :volume (pos-volume new-volume))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment