This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-02-22
Channels
- # aatree (2)
- # beginners (14)
- # boot (190)
- # cider (16)
- # cljs-dev (15)
- # cljsjs (6)
- # cljsrn (7)
- # clojure (101)
- # clojure-austin (26)
- # clojure-berlin (2)
- # clojure-estonia (4)
- # clojure-greece (53)
- # clojure-russia (46)
- # clojurescript (44)
- # core-async (12)
- # cursive (57)
- # data-science (49)
- # datomic (5)
- # emacs (8)
- # hoplon (92)
- # ldnclj (20)
- # lein-figwheel (22)
- # leiningen (4)
- # mount (37)
- # om (103)
- # onyx (26)
- # parinfer (70)
- # proton (6)
- # re-frame (32)
- # reagent (1)
- # yada (24)
Hey @micha I’m thinking of changing if-tpl
so that the conditional isn’t specified in :pred
. So that where once the structure was:
(if-tpl :pred truth
(true-tpl)
(false-tpl))
It would now be
(if-tpl truth
(true-tpl)
(false-tpl)
What do you think?hey, so I just noticed that I can do (div :class “foo”)
or (div { :class “foo” } )
equally well
is that so I can pass hash maps to my custom elements and pass them through to the core elements?
actually, I’ll just ask about what I’m looking at
if i want to do defelem
that just wants to set some values but passes the rest through, what should I do?
e.g. (defelem html-range [{:keys [min max step]} opts] (input :type “range” :min min :max max :step step))
so i could do that to get a little range slider, but then I don’t get to do things like :class
any more
really the only thing I want to set is :type “range”
, everything else should just pass straight through
what’s the best way to do that?
and on an unrelated note, how is automated testing done for hoplon?
and if it isn’t, would anybody be opposed to me writing tests using travis and https://github.com/semperos/clj-webdriver?
@micha: I think i fixed a gnarly race condition (don’t even know what was causing or how to reliably reproduce) by making things “more abstract"
good advice, i think
and testing with webdriver is completely fine, although not sure how travis would matter here
@dm3: well is there currently something running builds other than travis?
@dm3 thanks for the mapply tip, i’ll try it out tomorrow
https://circleci.com/, https://drone.io/ - haven't tried those though
i’ve tried circleci, it chokes on boot and runs out of memory
i’ve used drone in the past, it wasn’t as flexible or integrated with other systems as travis
alsooo, i already have travis working for a hoplon based project
so, i suggested it as I’ve already got some code snippets i can reuse
@thedavidmeister: you could do (defelem html-range [attrs opts] (input (assoc attrs :type "range")))
which leverages the fact that defelems happily accept a map as the first arg
well, i suppose i’ll pick that up again tomorrow
cya all
I was wondering how to get around the lazy UI loading problem in a Hoplon way. I have a number of things in a list that have a Header and a Content. Headers get rendered all at once and content is fetched asynchronously. Each Item has a content-ref
that gets resolved via an ajax call. It's kind of like how Castra mkremote
works, only I have cells defined dynamically inside the element (as I understand mkremote
only works for static state
/`error`/`loading` cells). I was thinking of something like:
(let [content (cell= (content/resolve (:content-ref item)))]
(div ...))
but this obviously doesn't work as resolve is asynchronous. I'd need resolve
to either return a cell
or accept a cell
to set once the ajax call is complete.
Seems like I'm missing something very basic here...so I did the following:
(defn object-cell [object-id-cell]
(with-let [result (cell (or (get @objects @object-id-cell) :in-progress))]
(do-watch object-id-cell
(fn [_ object-id]
(if object-id
(get-object result object-id) ;this does AJAX if necessary
(reset! result :in-progress))))))
where objects
is basically a cachealthough you will probably want to be swapping or resetting cells inside your fail/done/always callbacks
tried jqueryui autocomplete and selectize, but with not luck, I am suspecting I do something completely wrong
yeah, well that one uses a hoplon wrapper, which is on clojars, but vanished from github
the thing is, my do! method gets called, and throws no error, but there is no effect visible
which ensures that the element you're selectizing is in the dom when .selectize is called
unfortunately hoplon contrib is dead-ish
supplanted mostly by cljsjs, altho there were things it did that cljsjs doesn't, like auto css concatenation
(defmethod do! :selectize [elem _ opts] (with-init! (.selectize (js/jQuery elem) (clj->js opts))))
that should work
the defelem just has different affordances, like control over children... which maybe you don't need