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)
signature.asc
Description: Message signed with OpenPGP using GPGMail
