fix(newsletter): Use bound functions for callbacks, always.

This commit is contained in:
Ben Gotow 2016-11-07 14:07:05 -08:00
parent b3ec6048e9
commit 37bd069766

View file

@ -35,7 +35,7 @@ export default class NewsletterSignup extends React.Component {
this.setState(state);
}
_onGetStatus(props = this.props) {
_onGetStatus = (props = this.props) => {
this._setState({status: 'Pending'});
EdgehillAPI.makeRequest({
method: 'GET',
@ -53,7 +53,7 @@ export default class NewsletterSignup extends React.Component {
});
}
_onSubscribe() {
_onSubscribe = () => {
this._setState({status: 'Pending'});
EdgehillAPI.makeRequest({
method: 'POST',
@ -67,7 +67,7 @@ export default class NewsletterSignup extends React.Component {
});
}
_onUnsubscribe() {
_onUnsubscribe = () => {
this._setState({status: 'Pending'});
EdgehillAPI.makeRequest({
method: 'DELETE',