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

Add setTimeout fallback for requestAnimationFrame #988

Closed
wants to merge 1 commit into from

Conversation

brentertz
Copy link

Address issue #987 - Add setTimeout fallback for requestAnimationFrame

@valtlai
Copy link
Contributor

valtlai commented Jun 30, 2016

requestAnimationFrame doesn’t have the second parameter. Can you remove it, please?

@brentertz
Copy link
Author

Yep, removed. Not sure why that was in there in the first place or why I didn't notice it.

@Golmote
Copy link
Contributor

Golmote commented Jun 30, 2016

Indeed. It was there because it originally was a setTimeout and the person who changed it forgot to remove it.
It went unnoticed because that change was part of an unrelated PR...

@Golmote
Copy link
Contributor

Golmote commented Jun 30, 2016

Why 16, by the way?

@brentertz
Copy link
Author

brentertz commented Jun 30, 2016

60 frames per second (fps) is the target for smooth animations

1s or 1000ms / 60fps = ~16ms

@zeitgeist87
Copy link
Collaborator

You could also do it with a one-liner:

(requestAnimationFrame || setTimeout)(_.highlightAll, 0);

But it would be a bit of a hack and your solution is probably better.

@Golmote Golmote closed this in c9bdcd3 Jul 3, 2016
@Golmote
Copy link
Contributor

Golmote commented Jul 3, 2016

Just noticed you created the PR against the master branch. We currently work on gh-pages. The master is only updated on new release.
I merged this PR manually.

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.

None yet

4 participants