This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-02-15
Channels
- # adventofcode (13)
- # aleph (5)
- # announcements (8)
- # beginners (87)
- # calva (9)
- # cider (102)
- # cljs-dev (71)
- # cljsrn (2)
- # clojure (198)
- # clojure-dev (28)
- # clojure-europe (3)
- # clojure-italy (27)
- # clojure-nl (3)
- # clojure-spec (1)
- # clojure-uk (43)
- # clojurescript (121)
- # component (11)
- # cursive (20)
- # data-science (13)
- # datascript (2)
- # datomic (102)
- # dirac (4)
- # duct (5)
- # emacs (14)
- # figwheel-main (7)
- # fulcro (37)
- # hoplon (11)
- # jackdaw (3)
- # jobs (2)
- # leiningen (16)
- # nrepl (2)
- # off-topic (51)
- # pathom (34)
- # pedestal (12)
- # perun (10)
- # portkey (1)
- # re-frame (6)
- # reitit (1)
- # shadow-cljs (21)
- # spacemacs (8)
- # tools-deps (2)
- # vim (2)
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.jquery
namespace
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