1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-25 00:07:47 +01:00

Its now autopolling

This commit is contained in:
andsandv 2014-10-23 15:30:38 +02:00
parent f298215e1e
commit 877e634c96

View File

@ -166,6 +166,11 @@ var FeatureList = React.createClass({
},
componentDidMount: function () {
this.loadFeaturesFromServer();
setInterval(this.loadFeaturesFromServer, this.props.pollInterval);
},
loadFeaturesFromServer: function () {
reqwest('/features').then(this.setFeatures);
},
@ -230,6 +235,6 @@ var FeatureList = React.createClass({
});
React.renderComponent(
new FeatureList(null),
<FeatureList pollInterval={1000} />,
document.getElementById('content')
);