omcljs / om

ClojureScript interface to Facebook's React
6.65k stars 364 forks source link

om.next doesn't support implementing protocols with multiple functions #870

Closed TimovanderKamp closed 7 years ago

TimovanderKamp commented 7 years ago

When implementing a protocol with multiple functions some of them cannot be found in the meta (seem to be the odd-indexed ones).

(defprotocol twofunctions (twofunctions-one [this] "does something") (twofunctions-two [this] "does something too"))

(defui A static twofunctions (twofunctions-one [this] []) (twofunctions-two [this] []))

This would be the result of (meta A) : {:component-name "A", :component #object[user$eval54303$A__5430 0x423e3ce4"user$eval54303$A__54304@423e3ce4"], :component-ns user, :params #object[user$eval54303$fn__54306 0x44df84a3 "user$eval54303$fn__54306@44df843"], :twofunctions-one #object[user$eval54303$fn__54308 0x344f7985 "user$eval54303$fn__54308@344f7985"]}

'twofunctions-two' is missing.

(defprotocol threefunctions (threefunctions-one [this] "does something") (threefunctions-two [this] "does something too") (threefunctions-three [this] "does something aswell"))

(defui B static threefunctions (threefunctions-one [this] []) (threefunctions-two [this] []) (threefunctions-three [this] [])

This would be the result of (meta B) : {:component-name "B", :component #object[user$eval54349$B__54350 0x492e87a0 "user$eval54349$B__54350@492e87a0"], :component-ns user, :params #object[user$eval54349$fn__54352 0x4a465acc "user$eval54349$fn__54352@4a465acc"], :threefunctions-one #object[user$eval54349$fn__54354 0x6723488e "user$eval54349$fn__54354@6723488e"], :threefunctions-three #object[user$eval54349$fn__54356 0x13651293 "user$eval54349$fn__54356@13651293"]}

threefunctlon-two is missing.

TimovanderKamp commented 7 years ago

^ this happens server-side

anmonteiro commented 7 years ago

Thanks for bringing it up, I'll look into it soon.

awkay commented 7 years ago

I'm going to take a look and see if I can fix it.