Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lazy run interval #7

Merged
merged 1 commit into from
Jun 18, 2018
Merged

Lazy run interval #7

merged 1 commit into from
Jun 18, 2018

Conversation

Chocobozzz
Copy link
Contributor

Do not run interval on module import, but when we call the function.

Some SPA frameworks (like Angular) detect this timer call and run a change detection every 250ms. Now we run the timer only when we call the function, we have a way to say to the framework "execute the speedometer function but don't check the DOM when setInterval is fired."

Do not run interval on module import, but when we call the function. 

Some SPA frameworks (like Angular) detect this timer call and run a change detection every 250ms. Now we run the timer only when we call the function, we have a way to say to the framework "execute the speedometer function but don't check the DOM when `setInterval` is fired."
Chocobozzz added a commit to Chocobozzz/PeerTube that referenced this pull request Jun 18, 2018
So we don't run Angular change detection every 250ms on webtorrent
import, when mafintosh/speedometer#7 will be
merged
@mafintosh mafintosh merged commit 0454df9 into mafintosh:master Jun 18, 2018
@mafintosh
Copy link
Owner

Neat! Published in 1.1.0

@Chocobozzz
Copy link
Contributor Author

Thanks for you work @mafintosh!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants