Fork me on GitHub
#re-frame
<
2017-06-07
>
reefersleep09:06:25

@mikethompson I ended up with a bit of a frankenstein solution, where I do

{:component-did-update ;;TODO this causes way too many calls to .focus, wonder if I can reduce this with a different lifecycle hook?
            (fn [this]
(.focus (r/dom-node this)))

reefersleep09:06:05

My problem is that the input component to be focused is "rendered" when the app is rendered, it's just not visible until later (when its popup has opened) and by then, the user has of course moved the focus elsewhere. Therefore, :auto-focus seemed less viable. But then, there is nothing deterring me from conditionally rendering the input component only when its poup opens, so I think I can use that along with :auto-focus, to get the job done.

reefersleep09:06:25

I'll try it tonight 🙂

danielneal10:06:30

heya! what is the right way to go about making a :graphql-fx that uses :http-fx. I originally made a :graphql-fx that did the http calls directly but it feels a bit wrong

danielneal11:06:17

or should I write a graphql->http interceptor?

sandbags11:06:00

@andre hrmm I tried replicating the problem by deliberating changing an assoc-in to assoc and nothing bad happened. It's odd because I have had this problem where re-frisk would no longer display its contents and just print an error in the debugging popup. So it must be something else that is the trigger. It's happened a couple of times, if it happens again I will try and be more mindful about what's going on.

mokr17:06:53

I’m looking for a way to do “debounced dispatch” or “delayed subscription update” to avoid GUI responsiveness issues due to expensive subscription calculations. Does anyone have an idea?

plins19:06:12

hello everyone, sorry for the basic question but .. looking at the re-frame example i see

plins19:06:23

(defn main-panel []
  (let [active-panel (re-frame/subscribe [:active-panel])]
    (fn []
     [show-panel @active-panel])))

plins19:06:50

show-panel is a function, why there is no parentheses around it?

mokr19:06:18

@plins See this wiki article: https://github.com/Day8/re-frame/wiki/Using-%5Bsquare-brackets%5D-instead-of-%28parentheses%29 TLDR: “the square version will be more efficient at “re-render time”. Only the DOM which needs to be re-rendered will be done”

plins19:06:13

thank you, i ll dig deeper in the wiki 🙂

mokr19:06:01

You’re welcome. Notice the pages in the right hand menu in the wiki. At least for me they are collapsed by default and only shows “Pages 28”, instead of listing them.