This file contains 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
(defn component [] | |
(js/Reflect.construct js/HTMLElement #js [] component)) | |
(set! (.-prototype component) | |
(js/Object.create (.-prototype js/HTMLElement) | |
#js {:connectedCallback | |
#js {:configurable true | |
:value | |
(fn [] | |
(this-as this |
This file contains 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
{:deps | |
{org.clojure/clojure {:mvn/version "1.10.0-RC5"} | |
#_#_org.clojure/spec.alpha {:mvn/version "0.2.176"} | |
#_#_org.clojure/test.check {:mvn/version "0.10.0-alpha3"} | |
org.clojure/core.cache {:mvn/version "0.7.1"} | |
org.clojure/core.memoize {:mvn/version "0.7.1"} | |
}} |
This file contains 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
;; Let's start with a simple conditional interceptor that works with functions... | |
(defn conditional-context | |
"Given a keyword name and any variable predicate and terminator function pairs, | |
return an interceptor that will apply the terminator function paired to the first | |
truthy predicate. Predicates and terminators are both given the context as | |
the only argument. | |
If all predicates fail, the original context is returned." | |
[name-kw & pred-terms] |