I see this pattern in several demos (such as: https://github.com/hoplon/demos/blob/master/todoFRP/src/index.cljs.hl#L91), but when I try to replicate it I get an error since arg-1 to the
:change handler is a
js/Event object, which doesn't support
IDeref. Can someone explain this to me?
@robert.mather.rmm at least when the demos were written, e was a jquery event object, and we extended IDeref to it... you could do the same to make it work
i think maybe since jquery became optional that was removed, i don't know for sure though
I suspected something like that. Sounds likely to me. So I could just extend IDeref to the native Event type?
you can, yeah. shouldn't cause any problems, although extending the native types is poo-poo'd in some circles
since you're effectively mutating a global thing and whatnot
but hey, it's pretty convenient
@robert.mather.rmm make sure you are including the
hoplon.core + your attribute provider (usually jquery but could also be google closure)
@flyboarder Got it. Is that because the providers are set up via multimethods?
yes, and they are optional, there is a minimal amount of supported attributes via vanilla js but usually you will want the jquery provider