Skip to content

Instantly share code, notes, and snippets.

@andycarrell
Last active February 7, 2017 04:41
Show Gist options
  • Save andycarrell/7e80f6de5eb54262f18e00e1561349cf to your computer and use it in GitHub Desktop.
Save andycarrell/7e80f6de5eb54262f18e00e1561349cf to your computer and use it in GitHub Desktop.
class FormWithSomeCouponInput extends React.Component {
constructor(props) { ... }
handleSubmitCoupon() {
const { coupon, actions } = this.props;
actions.submitCoupon({ coupon });
}
handleCouponBlur() {
this.props.actions.applyBlur('coupon');
this.handleSubmitCoupon();
}
handleClearCoupon() {
this.props.actions.applyChange('coupon', '');
this.handleCouponBlur();
}
render() { ... }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment