reagent-project/reagent-forms — pull request #28 by aeriksson (2014-12-11 09:47:47+00:00)
Title: Properly handle external updates to atoms.

Currently, some forms do not properly update when the underlying atom changes.

For instance, in the following example (which has two selects operating on the same atom), changing one select will not update the other.
```clojure
(let [doc (atom {})
form [:select.form-control {:field :list :id :derp}
[:option {:key :foo} "foo"]
[:option {:key :bar} "bar"]]]
[:div
[bind-fields form doc]
[bind-fields form doc]])
```
Obviously, this behavior is not very reactive, and can cause headaches (it seems to be the problem in #19).

This commit fixes this behavior by making bind-fields return a form directly (rather than returning a function which returns a pre-computed form).

While this will incur a slight performance penalty on updates relative to the alternative, it shouldn't be noticeable.