Skip to content

Instantly share code, notes, and snippets.

@mbertheau
Last active September 22, 2015 14:46
Show Gist options
  • Select an option

  • Save mbertheau/3a90c1bc46ea660bc8ea to your computer and use it in GitHub Desktop.

Select an option

Save mbertheau/3a90c1bc46ea660bc8ea to your computer and use it in GitHub Desktop.
My first macro
(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)))
@Jyggafey

Copy link
Copy Markdown

style check is complaining about several pep8 issues!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment