This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-11-17
Channels
- # admin-announcements (9)
- # beginners (96)
- # boot (77)
- # cljs-dev (23)
- # cljsrn (18)
- # clojure (206)
- # clojure-austin (7)
- # clojure-conj (5)
- # clojure-japan (7)
- # clojure-poland (13)
- # clojure-russia (130)
- # clojure-taiwan (1)
- # clojurescript (125)
- # cursive (13)
- # data-science (2)
- # datascript (3)
- # datomic (2)
- # hoplon (24)
- # immutant (5)
- # jobs (4)
- # ldnclj (3)
- # ldnproclodo (2)
- # off-topic (2)
- # om (70)
- # onyx (12)
- # re-frame (6)
- # vim (2)
Noob question: I get that Hoplon integrates the jQuery event callbacks as hlisp attributes, and that you shouldn't need the selector part of the jQuery API. So how would you go about using other parts of the API, like Attributes/CSS, Manipulation, Effects, etc (http://oscarotero.com/jquery/)?
looking to start with a simple pattern like: (div :mouseover #(js/jQuery .fadeOut("slow"))
Also, if Hoplon requires cljsjs.jquery, is there a more succint way to refer to jQuery functions? Does (:require [cljsjs.jquery :as jq]) work? how would you use that? Thx!
since hoplon already does that and you are requiring hoplon implicitly in your .hl file
if you want to see examples of how to use jquery i think a good place to look is at the hoplon source
Thanks. still trying to cobble together a "hello jquery" something like... (defmethod do! :myfade [elem] (.fadeOut (js/jQuery elem) "slow")) ... (div :mouseover #(myfade)) ???
the do!
multimethod is a general type of thing to handle changes in state that need to be applied to an element
(defmethod do! :myfade
[the-element the-attribute-name the-attribute-value]
(cond (= "in" the-attribute-value)
(.fadeIn the-element "slow")
(= "out" the-attribute-value)
(.fadeOut the-element "slow")))
then you can wire up the attribute value to a javelin cell, and it will fade in and out according to a formula
Thanks a bunch, will play with that. So my intuition to invoke jQuery methods directly to mutate state was wrong . Better to go through custom element attribute syntax and use cells for canonical state management...?
yeah, the do!
and on!
multimethods let you put the jQuery direct manipulation stuff behind a nice, uniform interface
Hey there, are there any examples of integrating https://github.com/funcool/buddy into a hoplon castra setup?