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:
parent
7d433cd332
commit
c22229c205
@ -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);
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user