When I went through the tutorial, I didn't like the name "app". It's too 
general and not correct. I prefer "data" or "app-state". 

+1 on "self". (I will refrain from my rant on the use of the word "this" when 
referring to self... :-P)


On Apr 21, 2014, at 12:40 PM, Sean Corfield <[email protected]> wrote:

> Many of the examples for Om use the arguments [app owner] for component 
> functions. After playing with Om for about a month and building more and more 
> complex examples, I found that these names caused confusion for me.
> 
> Most of the examples have app-state def'd at the top-level and pass that into 
> om/root but then it's referred to as just app (or something domain-specific) 
> inside components. Since I think of the top-level component as my 
> "application", I've found it clearer to use app-state (or ...-state for 
> cursors within that) instead of app.
> 
> (and I'm torn between ...-state and ...-cursor right now because I'm not sure 
> whether emphasizing the difference between a cursor and a regular piece of 
> Clojure data is worth the extra naming distinction?)
> 
> Similarly, as I start to write helper functions that components call, which 
> are passed both app-state (or ...-state) and owner, I've found owner to be 
> less than helpful and started using self inside the component and a more 
> descriptive name in the helper function. For example, if my application 
> component needs to kick off a core.async event loop in will-mount, I'll pass 
> app-state and self to a helper function that will name the args [app-state 
> application] and it will run the go-loop.
> 
> 
> Are other folks following the Om examples' lead of app and owner, or are you 
> adopting distinct naming? (and if so, what sort of things?)
> 
> Sean Corfield -- (904) 302-SEAN
> An Architect's View -- http://corfield.org/
> 
> "Perfection is the enemy of the good."
> -- Gustave Flaubert, French realist novelist (1821-1880)
> 
> 
> 

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