day8 / re-com

A ClojureScript library of reusable components for Reagent
https://re-com.day8.com.au
MIT License
798 stars 147 forks source link

Default input on-change handler for atom models #104

Closed shader closed 7 years ago

shader commented 7 years ago

It would be super convenient if the on-change handler for input-text, etc. defaulted to #(reset! model %) whenever model is an atom.

Admittedly there will be many cases where that is not the desired action, but it seems like a reasonable default that can be easily overridden.

Gregg8 commented 7 years ago

re-com is often used within re-frame which will be providing subscriptions rather than ratoms, so this default could lead to errors which are difficult to understand. Our philosophy is that it's better to be specific in this case.

Gregg8 commented 7 years ago

Closing