The :hoplon: ClojureScript Web Framework - http://hoplon.io/
ro6 2019-02-15T02:40:22.002100Z

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

ro6 2019-02-15T18:32:52.004200Z

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

flyboarder 2019-02-15T21:08:54.005700Z

@robert.mather.rmm make sure you are including the hoplon.jquery namespace

flyboarder 2019-02-15T21:09:25.006400Z

hoplon.core + your attribute provider (usually jquery but could also be google closure)

ro6 2019-02-15T21:10:04.006900Z

@flyboarder Got it. Is that because the providers are set up via multimethods?

flyboarder 2019-02-15T21:27:19.008Z

yes, and they are optional, there is a minimal amount of supported attributes via vanilla js but usually you will want the jquery provider