Fork me on GitHub
#reagent
<
2017-01-24
>
piotr-yuxuan00:01:04

Hiya there! I haven’t found documentation for make-reaction optional parameters auto-run on-set and on-dispose, could you elaborate on them or tell me where I could find so? Thanks in advance!

artur05:01:54

@metametadata so how do I go about creating a local state for the component so that I could do what I am trying to do now?

artur06:01:05

I have tried to to make an anonymous function in the component but then it doesn't even render the component whatever is inside the anonymous function.

metametadata09:01:59

@artur you were on a right path - you need a Form-2 component to store the local state in it: https://github.com/Day8/re-frame/wiki/Creating-Reagent-Components#form-2--a-function-returning-a-function

artur17:01:41

If I have a link on my page that triggers a function, is there a way to force browse to go to top of the page?

gadfly36117:01:25

@artur

(defn- scroll-to-top []
  (.scroll js/window 0 0))

artur19:01:05

What might be correct way to serve reagent app on index.html with routing? Currently I am having this problem where main page has an intro text and a link that directs to /room and this is catched by reagent app. But when I enter the url directly on the browser with /room it gives me 404.