Closed allumbra closed 8 years ago
I'm not quite clear on the use case, could you provide a bit more specifics. Normally, if you have a collection of items you'd represent it with a list or a multiselect field.
Sorry if this is out of place my but my issue is very similar. Could you please document event handlers for nested collections? In the context of your live example this would be something like the BMI calculation but applied to the person's age. I've been attempting to create something along those lines for a project I'm working on. But the id parameter you are using to determine which field the change occurred on only returns the name of the top level data structure. In your example that would be person. So far I have:
(defn inc-age [[id] value { {:keys [age]} :person :as document}](when %28and %28some #{id} [:age]%29 age%29 %28assoc document :person %28 inc age%29%29))
But (inc age) is never hit because id will always say person, not person.age
each event should accept 3 parameters, so the inc-age function should looks as follows:
(defn inc-age [id value {{:keys [age]} :person :as document}]
;;do stuff with age
)
I want a form to edit a document (map) that has a contacts vector. It is unclear to me how to go about this using the library. Thanks!