This PR allows a user to pass a map of get/save!/update! functions to override the default bind-fields behavior for those events (as per #127). In particular, this will allow the user to make reagent-forms compatible with libraries like re-frame. For example:
In this version, bind-fields no longer supports the & events part since it seems redundant - the functions would have the same signature as the functions in above map.
In addition, visible? will now support passing an id to be used by the specified :get function.
In above example, an input like this:
@smogg I think we might've missed a few spots where doc is being dereferenced, such as here and here. I wonder if it might be better for :doc to point to a subscription to the entire document as opposed to doing (assoc doc :doc (:get doc)) for re-frame.
This PR allows a user to pass a map of
get/save!/update!
functions to override the defaultbind-fields
behavior for those events (as per #127). In particular, this will allow the user to makereagent-forms
compatible with libraries likere-frame
. For example:In this version,
bind-fields
no longer supports the& events
part since it seems redundant - the functions would have the same signature as the functions in above map.In addition,
visible?
will now support passing an id to be used by the specified:get
function. In above example, an input like this:would call
(deref (re-frame/subscribe [:some-subscription])
and the value returned would be used as a predicate for input's visibility.