Fork me on GitHub
#re-frame
<
2017-04-03
>
souenzzo01:04:16

But i really dont understand why not (defn component [db] [:div @(subscribe db [:sub])])

souenzzo01:04:09

It Will turn every component stateless, purely funcional and easy testable/mockable

gklijs06:04:35

For one it’s nice to be able te re-load everything but the state when developing.

gklijs08:04:29

And you still can make purely functional components, if you want. For example I have some input components, that only have a local atom, and do a dispatch when certain conditions are met.

fahey13:04:18

Is there a way to access, from within a re-frame view function, the corresponding DOM element? I mean, other than through event handlers like onClick? I'm trying to have a view react to a state change by scrolling itself into position, perhaps with scrollIntoView. Can't tell if I'm trying to invent an antipattern or just missing something obvious...

fahey14:04:10

@curlyfry Yes, that's exactly what I needed! Still not sure I'm going to shoot myself in the foot or not though. Does using a ref callback for the purpose of scrolling an element sound like a bad approach to you?

curlyfry14:04:16

@fahey Sounds like a good approach to me! Try it out and see what it feels like :)

fahey14:04:40

@curlyfry Ok, I will. Thanks for your help!