var React = require("react"); var FeatureStore = require('../../stores/FeatureStore'); var ArchiveFeatureComponent = React.createClass({ getInitialState: function() { return { archivedFeatures: [] }; }, removeToggleFromState: function(item) { var updatedArchive = this.state.archivedFeatures.filter(function(f) { return f.name !== item.name; }); this.setState({archivedFeatures: updatedArchive}); }, onRevive: function( item) { FeatureStore.reviveFeature(item).then(this.removeToggleFromState.bind(this, item)); }, componentDidMount: function () { FeatureStore.getArchivedFeatures().then(function(data) { this.setState({archivedFeatures: data.features}); }.bind(this)) }, render: function () { return (
Name |
---|