Given I've defined a protocol
(defprotocol SubscriptionListener
(onConnection [cid] "")
(onUpdate [cid data] ""))
And I am interacting with a library in which a javascript object with this interface is passed in as follows
(js/somelib.connect url listener)
Is there an easy way to create a javascript object using the defined protocol?
I have tried to reify the protocol:
(js/somelib.connection "localhost" (reify SubscriptionListener
(onConnection [cid] (println cid))
(onUpdate [cid data] (println data))))
However this does not give an object that is compatible with external libraries.
Thanks