sindresorhus / p-event

Promisify an event by waiting for it to be emitted

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Clear timeout when cancelled?

chmanie opened this issue · comments

I feel like a more intuitive behaviour would be when the timeout is cleared when I cancel the promise. Like this when I cancel, I'm still getting the timeout errors which are not really what I was expecting when calling .cancel().

Maybe this is even an issue for p-timeout (to be able to clear the timeout from outside).

I'll happily help out with a PR here.

Yes, this is a bug. PR welcome to fix it :)

commented

hi @sindresorhus, is the issue still available? i want to give a try.