If I have a form that is editing an active object, I have a "edit-object" field 
that contains the value of the object, not just the ID.  This gives me a 
staging area to hold the edited object, which I can write back to the original 
object if the form is saved.

If you want the form to allow users to immediately update the object without a 
staging area, I would use an "active-id" field, and then have a parent 
component resolve the appropriate object cursor to pass to the form component.

On Monday, January 19, 2015 at 8:12:16 PM UTC-6, Ivan Willig wrote:
> Hello, 
> 
> 
> 
> I am struggling with how to best represent the common UI pattern where there 
> is a collection of objects and a single "active/current" object. Often there 
> is a form where the user can edit the "active" object.
> 
> 
> I find myself saving a reference to the current id and then looking up that 
> object from the collection. This seemed to be the direction that David was 
> going with in the immutable-stack, 
> https://github.com/KitchenTableCoders/immutable-stack/blob/master/contacts/src/cljs/contacts/core.cljs#L24-L27,
>  but I wanted to ask if there was an undated version. 
> 
> 
> Do other people have other solutions? 
> 
> 
> Thanks
> 
> 
> 
> 
> 
> Ivan Willig

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/clojurescript.

Reply via email to