Re: [ClojureScript] Om root atom best practices

2014-10-03 Thread David Nolen
I think you understand what it's for. I'm just demonstrating how to write it not how use it. David On Fri, Oct 3, 2014 at 3:26 PM, Peter Jaros wrote: > Oh, maybe I don't understand, then. What's `-resolve` for? Or, where > would you call it? > > Peter > > On Fri, Oct 3, 2014 at 10:29 AM, David N

Re: [ClojureScript] Om root atom best practices

2014-10-03 Thread Peter Jaros
Oh, maybe I don't understand, then. What's `-resolve` for? Or, where would you call it? Peter On Fri, Oct 3, 2014 at 10:29 AM, David Nolen wrote: > That's correct, I'm not actually using `-resolve` in the example yet. > > David > > On Fri, Oct 3, 2014 at 10:18 AM, Peter Jaros wrote: >> Brillian

Re: [ClojureScript] Om root atom best practices

2014-10-03 Thread David Nolen
That's correct, I'm not actually using `-resolve` in the example yet. David On Fri, Oct 3, 2014 at 10:18 AM, Peter Jaros wrote: > Brilliant, I had a thought like this earlier in the week, but I had no > idea how to implement it. > > But, David, I'm not sure I follow your code. `-resolve` doesn't

Re: [ClojureScript] Om root atom best practices

2014-10-03 Thread Peter Jaros
Brilliant, I had a thought like this earlier in the week, but I had no idea how to implement it. But, David, I'm not sure I follow your code. `-resolve` doesn't appear to be used anywhere. Is that an oversight, or am I missing something? Peter On Fri, Oct 3, 2014 at 8:54 AM, David Nolen wrote:

Re: [ClojureScript] Om root atom best practices

2014-10-03 Thread David Nolen
I've updated the example to show how to dynamically add resolution capabilities to all cursors in an application: https://github.com/swannodette/om/blob/f63af72522f0a0045edbada19259b6b17f5d1dcf/examples/two_lists/src/core.cljs I'm starting to think this approach is very promising - this is already

Re: [ClojureScript] Om root atom best practices

2014-10-02 Thread Todd Berman
Very interesting! I like the use of specify to create the collections, it makes a lot of sense. How would you extend it so that instead of: {:list0 [:a :b :c] :list1 [:d :e :f] :items {:a {:text "cat"} :b {:text "dog"} :c {:text "bird"} :d {:text "lion"} :e

Re: [ClojureScript] Om root atom best practices

2014-10-02 Thread David Nolen
I spent some time thinking about your problem today and it's leading me towards something which may address it and the numerous variations of this problem. At the moment I only have the following short code snippet - it uses specify in some interesting ways that I think people may be overlooking:

Re: [ClojureScript] Om root atom best practices

2014-10-02 Thread Todd Berman
Problems is a strong word, probably too strong. It felt odd to store the data inline there, and it caused some issues with creating new items (which aren't in any list yet, but will be bucketed by the server upon creation). Our server backend models lists very similarly (where the list is a lis

Re: [ClojureScript] Om root atom best practices

2014-10-02 Thread Jamie Orchard-Hays
Interesting problem. I've developed an Om component that allows the creating and editing of recursive trees with various kinds of lists, but haven't had the need to move a list or an item to a different one, so haven't tackled this particular problem. What were the issues caused with your first

[ClojureScript] Om root atom best practices

2014-10-02 Thread Todd Berman
I am in the middle of writing my first large OM/CLJS app, and have run into something that feels wrong, and I am curious if other people have come up with better solutions for it. I am writing a CMS-type app that allows you to edit/create data objects that are stored in various lists. Originall