Skip to content

Instantly share code, notes, and snippets.

@mightybyte
Last active March 3, 2016 10:21
Show Gist options
  • Save mightybyte/e2d08f861aca79d12ab0 to your computer and use it in GitHub Desktop.
Save mightybyte/e2d08f861aca79d12ab0 to your computer and use it in GitHub Desktop.
Small snippet illustrating the use of http://reply.obsidian.systems
(define-syntax elAttr
(syntax-rules ()
((elAttr tag attrs children ...)
(eval-element 'tag 'attrs 'children ...))))
(define-syntax el
(syntax-rules ()
((el tag children ...)
(elAttr tag () children ...))))
(el "h2" (text "Reflex Twitter"))
(el "div" (define x (textInput)))
(el "div" (define b (button "Tweet")))
(define val (holdDyn "none" (mapEvent (lambda (e) (sampleDyn x)) b)))
(dynText val)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment