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

Calling clock.clear() inside a callback function breaks the tick #16

Closed
renatopp opened this issue Jul 14, 2019 · 0 comments · Fixed by #17
Closed

Calling clock.clear() inside a callback function breaks the tick #16

renatopp opened this issue Jul 14, 2019 · 0 comments · Fixed by #17

Comments

@renatopp
Copy link
Contributor

When you try to clear the clock inside a timeout or interval callback, the tick function fail:

TypeError: Cannot read property 'active' of undefined

Reproducing it:

const clock = new ClockTimer();

clock.setTimeout(() => {}, 0);
clock.setTimeout(() => {
  clock.clear();
}, 0);
clock.setTimeout(() => {}, 0);

clock.tick();
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 a pull request may close this issue.

1 participant