Skip to content

Instantly share code, notes, and snippets.

@cmoore
Last active December 20, 2015 02:00
Show Gist options
  • Save cmoore/a34033658d691785c5a2 to your computer and use it in GitHub Desktop.
Save cmoore/a34033658d691785c5a2 to your computer and use it in GitHub Desktop.
An example of the syntax.
(define-easy-handler (react-stuff :uri "/react/all") ()
(send-react
(defvar panel (defreact
(json display-name "Panel"
component-will-mount (lambda ()
;; (->) is (ps:chain) and (.>) bind()s 'this' to the block.
(something-with-a-callback (.> (lambda (x) (-> this (do-something)))))
render (lambda ()
(rce "div" (json class-name "col-md-6")
(rce "div" (json class-name "panel panel-default panel-borders")
(rce "div" (json class-name "panel-heading")
(@ this props header))
(rce "div" (json class-name "panel-body")
(@ this props body))))))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment