1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-28 00:06:53 +01:00

Stop timer in componentWillUnmount

This commit is contained in:
Jari Bakken 2014-10-27 13:29:47 +01:00
parent 7d433cd332
commit c22229c205

View File

@ -209,7 +209,7 @@ var Unleash = React.createClass({
savedFeatures: [],
unsavedFeatures: [],
errors: [],
poller: null
timer: null
};
},
@ -219,6 +219,12 @@ var Unleash = React.createClass({
this.state.timer.start();
},
componentWillUnmount: function () {
if (this.state.timer != null) {
this.state.timer.stop();
}
},
loadFeaturesFromServer: function () {
reqwest('features').then(this.setFeatures, this.handleError);
},