1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00

Its now autopolling

This commit is contained in:
andsandv 2014-10-23 15:30:38 +02:00 committed by Ivar Conradi Østhus
parent 7e48350b83
commit 91e9141a01

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')
);