-
-
Notifications
You must be signed in to change notification settings - Fork 157
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
Implement animationFrame()
yieldable
#365
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
two tiny docs things I noticed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, looks great to me. Could you add a quick test?
any suggestions on how to test this? 😅 |
Could add a unit test that stubs out rAF (sinon should be available in the test suite) and asserts that the correct things are called and that the task runs to completion without error (might not even need to stub out rAF) Adding to these existing tests too would be good:
|
@maxfierke I've added some tests but I fail to understand why the TS typing tests are failing. They seem to work alright locally. @chancancode any clues? |
@maxfierke @chancancode any ideas how to proceed? the failing tests seem unrelated to the code that I introduced here 🤔 |
Looks like those typescript tests are also failing in #368. I'll take a look at it this week and try and figure it out |
@Turbo87 master's passing now, if you want to give this a rebase? |
hmm, seems there is still an unrelated test failing. or maybe it's just flaky. can you restart the failed test to check? |
yeah, that's just a flaky one. I queued up a restart on that failed job but doesn't seem to be taking. I'll merge as-is |
This PR implements a
animationFrame()
utility that wraps the nativerequestAnimationFrame()
API and can be used viayield animationFrame()
(similar toyield timeout(1000 / 60)
).Related: #169