Quantcast
Channel: Ember.JS - Latest topics
Viewing all articles
Browse latest Browse all 4828

Property/Action Naming Best Practices

$
0
0

@onsmith wrote:

How do you name your computed properties and actions?

For example, suppose you have a settings-manage-panel component that should only be shown if the user is an administrator. You therefore make a boolean computed property that is true if the user is an administrator, or false if the user is not. Do you name the property userIsAdmin or do you name it showManagementPanel? Basically I'm asking should the computed property be named after what it is or what it's used for?

Similarly, suppose you have a form with a submit button that creates a new post resource. Do you name the action postFormSubmitted or createPost? Worded differently, should actions be named after what caused them or what they should do once triggered?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4828

Trending Articles