Skip to content

Commit

Permalink
Now set delay for feed widget dynamically
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewbdaly committed Aug 15, 2016
1 parent b9f9322 commit 95e07ab
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion js/components/feedwidget.js
Expand Up @@ -21,7 +21,7 @@ export default React.createClass({
},
componentDidMount() {
this.getFeed();
this.interval = setInterval(this.getFeed, 60000);
this.interval = setInterval(this.getFeed, (this.props.delay * 1000));
},
componentWillUnmount() {
clearInterval(this.interval);
Expand Down
2 changes: 1 addition & 1 deletion test/components/feedwidget.js
Expand Up @@ -10,7 +10,7 @@ describe('Feed Widget', () => {
it('renders the Feed widget', () => {
const url = "http://feeds.bbci.co.uk/news/rss.xml?edition=uk"
const component = renderIntoDocument(
<FeedWidget feed={url} size={5} />
<FeedWidget feed={url} size={5} delay={60} />
);
const feed = findDOMNode(component.refs.feed);
expect(feed).to.be.ok;
Expand Down

0 comments on commit 95e07ab

Please sign in to comment.