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

Use requestAnimationFrame #5

Merged
merged 1 commit into from
Nov 20, 2016
Merged

Use requestAnimationFrame #5

merged 1 commit into from
Nov 20, 2016

Conversation

fregante
Copy link
Contributor

@fregante fregante commented Nov 7, 2016

Fixes #2

@asvd
Copy link
Owner

asvd commented Nov 8, 2016

By the way: is there any reason to use window. here? Why not just (requestAnimationFrame || setTimeout)(tick, 1)?

@fregante
Copy link
Contributor Author

fregante commented Nov 8, 2016

Because accessing an undefined property just gives undefined; accessing an undefined variable throws ReferenceError: requestAnimationFrame is not defined

The alternative would be using this, but it's longer:

(typeof requestAnimationFrame === 'function' ? requestAnimationFrame : setTimeout)

@asvd asvd merged commit 6fe76fe into asvd:master Nov 20, 2016
@asvd
Copy link
Owner

asvd commented Nov 20, 2016

Released in v0.2.2. Thanks for the contribution!

@fregante
Copy link
Contributor Author

Whohooo

@fregante fregante deleted the patch-1 branch November 21, 2016 02:18
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.

3 participants