Fork me on GitHub
#re-frame
<
2017-06-14
>
sandbags07:06:33

Not sure if everyone already knew about this but I am finding https://github.com/rauhs/klang an excellent adjunct to re-frisk and replacement for high-level println/console debugging (I still dump detail to the console)

sandbags08:06:43

@andre something i would find really useful is being able to "prime" re-frisk with important keypaths for my app and have them turned into bookmarks into the app-db.

danielneal11:06:44

Do you always have to have an event handler registered for every event in re-frame? With the async-flow-fx, I've found myself wanting to listen to events that particpiate in the flow, but are no-op in terms of db and effects. I've put in dummy no-op event handlers but wondering if this is necessary or there is another way.

mikethompson11:06:02

@danieleneal no other way, currently. Events need a handler

danielneal11:06:08

cool thanks! Good to know for sure 🙂

lsenta15:06:15

Hey #re-frame'rs, is there a way to schedule a piece of code to be run after the rendering?

lsenta15:06:45

I want to scroll to the bottom of a div after I updated it

danielneal15:06:05

you might be able to use a form-3 component with component-did-update

danielneal15:06:33

but that's not reframe specific, just react

lsenta15:06:50

Ho yea, thanks for the quick reply @danieleneal!

(defn scrollBottom! [this]
  (let [o (reagent/dom-node this) #_(.getElementById js/document id)]
    (set! (.-scrollTop o) (.-scrollHeight o))))

(defn my-component [...]
  (let [... subscribscriptions]
    (reagent/create-class
      {:component-did-update
       (fn [this old-argv]
         (scrollBottom! this))
       :reagent-render
       (fn [...] old-render)})))

lsenta15:06:55

IIRC, the dom-node method was going to be deprecated by the react team, is it safe to use now?

danielneal16:06:18

ah I don't know I'm afraid @lsenta - but you might be right

lsenta16:06:12

Ho yea, that's it

lsenta16:06:52

Thanks for finding the link Daniel, I'll keep an eye on it 🙂