Instead of using paths, I probably would have done this via some kind of id.

David


On Sat, Feb 22, 2014 at 11:07 PM, Colin Kahn <[email protected]> wrote:

> Hi,
>
> I'm mainly an Angular dev that's been playing around with Om. I decided to
> make a test application, one that included editing, a recursive tree,
> filtering and adding items, to see how Om worked. I just finished updating
> the app to 0.5.0 and was hoping to get some insight on how functional
> programmers would have solved some of the problems I encountered.
>
> One thing that really stood out as I was working on this was how much I
> had previously relied on passing around references to objects and then
> updating them in different contexts. This was an issue in this app in both
> the editing/updating of items, as well as adding new items.
>
> I ended up relying on the Om cursor path for both of these:
>
> - Storing the item cursors path:
> https://github.com/colinkahn/omdeps/blob/master/src/omdeps/main.cljs#L79
> - Updating the item using the stored path:
> https://github.com/colinkahn/omdeps/blob/master/src/omdeps/main.cljs#L73
> - Similar for delete:
> https://github.com/colinkahn/omdeps/blob/master/src/omdeps/main.cljs#L58
>
> Is this a good way to solve this problem? Is there a different way I could
> structure my app to achieve this in another way?
>
> Thanks!
>
> --
> 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.
>

-- 
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