smashingboxes / web-boilerplate

A template for new front-end projects.
3 stars 2 forks source link

Remove rule requiring all event handlers to start with 'handle' #17

Closed greg5green closed 8 years ago

greg5green commented 8 years ago

Why?

It'd be super cool if all event handlers were named great, but this rule presents a problem when passing down action creators.

With the rule enforced, onChangeText={this.props.actions.credentials.setUserEmail} is an error. It would expect it to be onChangeText={this.props.actions.credentials.handleSetUserEmail}, which is kind of a crappy name for an action creator (they should be named for what they do, not what they handle -- there isn't necessarily any link between an action creator and what event fires to call that method).

Enforcing a method named handleSetUserEmail that was specific to this component would be very cool (like onChangeText={this.handleSetUserEmail}), but it isn't an option to have it not apply to methods that were passed down from another function.

What changed?

zachary-kuhn commented 8 years ago

Looks great!