-
Notifications
You must be signed in to change notification settings - Fork 3.5k
[Question] naming action #63
Comments
Not a maintainer but I started doing : src/constants/X/Y.json Which might look like: { Sent from my iPhone
|
I would try and not use the event trigger in an action name, for example 'CLICKED'. You could envision using the same code on a mobile app so it would in fact be triggered by a touch event and not a click. Minor point though. I'd tend toward an imperative, command approach, i.e. PERFORM_THIS_ACTION and not include what triggered the action or how it should be done. |
I've grown to prefer the reverse syntax of |
Great, thanks guys for the feedback! It's all what I wanted to know. |
I'd like to discuss best practices about naming actions. Currently I use actions named after what user has done, for example 'FILE_CLICKED', 'ZOOMED', 'VIEW_MODE_BUTTON_CLICKED' etc, is that good convention to name action like that? Only issue I see so far is that I have many *._CLICKED actions. Some people also tend to name actions more like commands, for example 'LOAD_DOCUMENT', 'CHANGE_VIEW_MODE' etc. I'd love your thoughts on that.
The text was updated successfully, but these errors were encountered: