Fork me on GitHub
#re-frame
<
2017-08-13
>
jebberjeb16:08:10

@akiroz having to declare actions as const is more a failing of Javascript in general, than Redux in particular. Clojure’s rich data literals — keywords in this case — I think let us avoid stuff like that in many cases.

profgra17:08:56

Hi, I managed to use an input field without using a ratom but used this as attributes: :value @(rf/subscribe [:id]) and :on-change #(rf/dispatch [:event-id (-> % .-target .-value)]). What would be the benefits of using a ratom? Robustness facing conccurency? Thanks.

nenadalm17:08:39

@profgra If you want to dispatch value of the input for each change, then there is no need to use ratom. If you wanted to dispatch the value on latest change (e.g. by clicking some button) - then you would have to store the value somewhere in the component (in ratom) before dispatching it.

nenadalm17:08:34

@profgra you might check react forms documentation for more details for the ratom case on what I've tried to describe: https://facebook.github.io/react/docs/forms.html

profgra18:08:50

Thanks @nenadalm I'll check your doc suggestions.

profgra18:08:52

@nenadalm but how can we know the value of the input from the button? I thought that every value had to be in app-db?

nenadalm18:08:04

@profgra you can use on-change event to update the ratom and then when you click the button, you dispatch value of the ratom.

profgra18:08:44

This part is fuzzy to me: «when you click the button, you dispatch value of the ratom».

scknkkrer18:08:06

I know that why this language dying. Nobody cares about newbies…

scknkkrer18:08:12

Thank you all guys.

nberger19:08:52

@scknkkrer try asking in #cljsrn