Fork me on GitHub
#re-frame
<
2017-07-05
>
fabrao05:07:27

@akiroz You said to leontalbot to use npm-deps, I tried with react-data-grid, but require is not recognize it. What I´m missing?

akiroz08:07:29

@fabrao What's the error message?

fabrao13:07:23

@akiroz It seems that cljs compiler can´t create npm process. The error is java.io.IOException: Cannot run program "npm": CreateProcess error=2, I think it´s because I´m running in Windows

mattly18:07:25

I'm seeing some weird behavior with component updating and subscriptions that I'm not sure I understand what the correct behavior is supposed to be

mattly18:07:05

I have a table, and a subscription visible-rows that contains a sequence of items that get rendered like so: (for [row @visible-rows] [:div.row {:key (:id row)} [item-row row]])

mattly18:07:46

the item-rows component has its own subscriptions, let's say to visible-columns, so it looks kinda like this:

bradleesand18:07:24

you may want to wrap the for with doall

mattly18:07:56

the actual code does that, I omitted it for brevity

mattly18:07:14

anyway, when an individual row changes, it doesn't re-render

mattly18:07:25

am I supposed to have a per-row subscription in this case?

mattly18:07:44

I prototyped that out and it works, but I thought that if the arguments to a component changed it was supposed to re-render

bradleesand18:07:56

oh, you need to do

(defn item-rows [row]
  (let [....]
    (fn [row]
      .....

mattly18:07:50

am I supposed to shadow all provided arguments or just the ones that changed?

mattly18:07:25

In some cases I'm building subscriptions based on the arguments

mattly18:07:33

but those arguments don't change

bradleesand19:07:25

you only need to shadow arguments that can change

mattly19:07:11

ok, thanks; got it mostly working now, just running into a problem for child components