mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-01 00:08:27 +01:00
Stop timer in componentWillUnmount
This commit is contained in:
parent
7d433cd332
commit
c22229c205
@ -209,7 +209,7 @@ var Unleash = React.createClass({
|
|||||||
savedFeatures: [],
|
savedFeatures: [],
|
||||||
unsavedFeatures: [],
|
unsavedFeatures: [],
|
||||||
errors: [],
|
errors: [],
|
||||||
poller: null
|
timer: null
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -219,6 +219,12 @@ var Unleash = React.createClass({
|
|||||||
this.state.timer.start();
|
this.state.timer.start();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
componentWillUnmount: function () {
|
||||||
|
if (this.state.timer != null) {
|
||||||
|
this.state.timer.stop();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
loadFeaturesFromServer: function () {
|
loadFeaturesFromServer: function () {
|
||||||
reqwest('features').then(this.setFeatures, this.handleError);
|
reqwest('features').then(this.setFeatures, this.handleError);
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user