Fork me on GitHub
#clojurescript
<
2016-08-11
>
josh_tackett01:08:44

(attribute d {:tag :li :data-click "exportOrderGuide" :data-format "excel"} :id )

josh_tackett01:08:52

Can anyone show me how to do a java script hover on this element: #clj_webdriver.element.Element{:webelement #<Tag: <li>, Class: dropdown-submenu pull-left, Value: 0, Object: [[ChromeDriver: chrome on XP (8ff1a709570edb6244915d8fb4bd8c04)] -> xpath: //li[@class='dropdown-submenu pull-left']]>}

mac06:08:23

@martinklepsch The bluemix article you mentioned.

arnaudcys07:08:28

Hi everyone, I just started clojurescript-om tutorial (https://github.com/omcljs/om/wiki/Basic-Tutorial)

arnaudcys07:08:59

however, I have an error after lein new figwheel om-tut -- —om; cd om-tut; lein figwheel

arnaudcys07:08:15

Failed to compile "resources/public/js/compiled/om_tut.js" in 2.775 seconds.
----  Could not Analyze  src/om_tut/core.cljs   line:48  column:9  ----

  No implementation of method: :emit-instruction of protocol: #'cljs.core.async.impl.ioc-macros/IEmittableInstruction found for class: cljs.core.async.impl.ioc_macros.Jmp

  46  (will-mount [_]
  47    (let [delete (om/get-state owner :delete)]
  48      (go (loop [])
          ^--- No implementation of method: :emit-instruction of protocol: #'cljs.core.async.impl.ioc-macros/IEmittableInstruction found for class: cljs.core.async.impl.ioc_macros.Jmp
  49        (let [contact (<! delete)]
  50          (om/transact! data :contacts
  51            (fn [xs] (vec (remove #(= contact %) xs))))

----  Analysis Error : Please see src/om_tut/core.cljs  ——

arnaudcys07:08:21

can someone help me? please

jm07:08:44

@arnaudsj: looks like you’re closing the loop function early

arnaudcys07:08:14

@jm: I did not touch anything

arnaudcys07:08:27

it’s just the default file for the om-tut

arnaudcys07:08:31

(defn contacts-view [data owner]
  (reify
    om/IInitState
    (init-state [_]
      {:delete (chan)})
    om/IWillMount
    (will-mount [_]
      (let [delete (om/get-state owner :delete)]
        (go (loop [])
          (let [contact (<! delete)]
            (om/transact! data :contacts
              (fn [xs] (vec (remove #(= contact %) xs))))
            (recur)))))
    om/IRenderState
    (render-state [this {:keys [delete]}]
      (dom/div nil
        (dom/h2 nil "Contact list")
        (apply dom/ul nil
          (om/build-all contact-view (:contacts data)
            {:init-state {:delete delete}}))))))

jm07:08:43

Odd, that doesn’t look right. 1 sec, i’ll try run it

thheller07:08:38

(loop []) that is not valid

thheller07:08:58

move the let into the loop

arnaudcys07:08:08

(go (loop [let [contact (<! delete)]])
            (om/transact! data :contacts
              (fn [xs] (vec (remove #(= contact %) xs))))
            (recur))))

arnaudcys07:08:27

sorry, just starting with closure

jm07:08:53

the closing paren should be after that recur

jm07:08:15

(go (loop []
              (let [contact (<! delete)]
                (om/transact! data :contacts
                  (fn [xs] (vec (remove #(= contact %) xs))))
                (recur))))))

arnaudcys07:08:48

@jm: thanks! it works.

arnaudcys07:08:44

I wonder if it’s not parinfer that modified the parentheses

shidima08:08:48

I’m working through Learning ClojureScript, the chapter im in is working on piggieback, but when I open my browser I get the error Error: goog.require could not find: piggieback_project.core

shidima08:08:12

But I cant seem to find out where the error is.

shidima08:08:06

omg, need to call the core.clj file core.cljs :S

lprefontaine11:08:38

You are not alone 😁 that bites me from time to time

uwo16:08:50

Funny I’ve never needed this, but is it possible to access javascript’s coerced equality ==? This is the expression I’m trying to replicate e.target == document.documentElement

mattly16:08:23

@uwo: you might be able to use .isEqualNode on one or other of the elements for comparison

uwo16:08:36

ha! thanks. was just looking at that

uwo16:08:47

unfortunately that doesn’t work

dnolen17:08:09

@uwo coercive-= is a thing not recommended otherwise of course

uwo17:08:13

@dnolen: awesome, thanks! I found a better solution that doesn’t require coercive comparison

reefersleep18:08:05

Does anyone have any experience with using css animations and Reagent? I've got an element reacting to a r/atom called transforming? thusly: :transform (if @transforming? "scale(1,0)" "none"), and a different element changing the value of transforming? like this:

:on-change (fn [check-node] (let [flip-transforming? #(swap! transforming? not)
                                       toggled-check (get-checked check-node)]
                                   (flip-transforming?)
                                   (reset! checkbox-state toggled-check)))
However, the reset! also causes a visual change to the same element that subscribes to the value of transforming?, and (I'm guessing) since flip-transforming? and the reset! occur right after one another and within the same "tick", the scale(1,0) never occurs. I've tested with the reset commented out, and then, the animation appears correct. How can I ensure that Reagent "waits" for css animations to finish?