jasonpincin / callback-timeout

Executes callback with single error argument if timeout is exceeded before it's called naturally

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Why do you need to clear timeout when the timeout is called?

soichih opened this issue · comments

I am trying to study this code, and I can't quite understand why this line exists.

clearTimeout(timer)

Can you explain why this line needs to exist?

Good catch; you're correct, it does not need to exist.

Removed that unnecessary statement and published 3.0.1. Thanks for opening the issue!