Last active
September 22, 2015 14:46
-
-
Save mbertheau/3a90c1bc46ea660bc8ea to your computer and use it in GitHub Desktop.
My first macro
This file contains hidden or 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
(defmacro defhandler | |
[handler-name argv body] | |
`(re-frame.core/register-handler | |
~(keyword (name handler-name)) | |
(comp re-frame.core/debug re-frame.core/trim-v) | |
(fn ~(if (> (count argv) 1) | |
(vec (list (first argv) (vec (rest argv)))) | |
argv) | |
~body))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
style check is complaining about several pep8 issues!