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

utils/rawTimeout: Use clearTimeout() instead of clearInterval() #309

Merged
merged 1 commit into from Jul 23, 2019

Conversation

Turbo87
Copy link
Contributor

@Turbo87 Turbo87 commented Jul 23, 2019

When writing tests that fake time with lolex it complains:

Cannot clear timer: timer created with setTimeout() but cleared with clearInterval()

There is no clear reason for using clearInterval() here for something that was created with setTimeout(). Using clearTimeout() instead seems more straight forward and would solve this issue.


Unrelated: I noticed that rawTimeout() is undocumented and not exported from the top-level file. Is there a reason for that? Is it not supposed to be used?

When writing tests that fake time with `lolex` it complains:

> Cannot clear timer: timer created with setTimeout() but cleared with clearInterval()

There is no clear reason for using `clearInterval()` here for something that was created with `setTimeout()`. Using `clearTimeout()` instead seems more straight forward and would solve this issue.
@machty machty merged commit 94e8c62 into machty:master Jul 23, 2019
@Turbo87 Turbo87 deleted the patch-1 branch July 23, 2019 15:28
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

2 participants