Skip to content

Instantly share code, notes, and snippets.

@thheller
Forked from tiye/a.cljs
Last active June 12, 2017 08:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thheller/405951452cf872eb16ba2d4e1fb5a117 to your computer and use it in GitHub Desktop.
Save thheller/405951452cf872eb16ba2d4e1fb5a117 to your computer and use it in GitHub Desktop.
Exploring if I can get Respo component simpler. Tried in Lumo.
(ns demo.a
(:require [demo.b :refer [defcomp]]))
(defcomp my-comp [x y] 1)
(println my-comp)
(ns demo.b)
(defmacro defcomp [comp-name params body]
`(def ~comp-name
(demo.b/create-comp ~(keyword comp-name)
(~'fn [~@params]
(~'fn [~'cursor] ~body)))))
(ns demo.b
(:require-macros [demo.b]))
(defn create-comp [comp-name body]
[comp-name body])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment