In Clojure (not ClojureScript), how can I check that a given component implements a protocol?
(defui MyComp
static my-protocol
(aaa [this] []))
(satisfies? my-protocol MyComp) ;; false
(satisfies? om.next.protocols/IReactChildren MyComp) ;; false
;; but
(.aaa ( MyComp nil nil nil nil)) ;; []
As far as I understand now, this is not supported directly by om.next, since
defuidoes not behave exactly likedefrecord.One way (used by untangled) is to put the implementation of the protocol in the
metadata. Conversation with tony kay:This is also how it is done inside om.next for server-side rendering.
It can also be seen in om-css https://github.com/ladderlife/om-css/blob/dd19235dabca74db1669504fff941ff97abddcc4/src/main/om_css/core.cljc#L240-L242
Unfortunately since these approach require overwriting
defuithey do not compose together very well.