Closed callmehiphop closed 4 years ago
Bump :)
hmm do clearing queue means settings current queue length to 0 sufficient only?
@shirshak55 it's a personal preference for emptying arrays, allows us to re-use the same array without increasing the time complexity (I think).
@callmehiphop yea I think it is correct and best option here. Was just worried like lets say there are 2 promise and are running and we reset the queue but those promises would still be running and user may think pending count is 0 meaning javascript is doing nothing (But in reality its still running those promises.) . Yea I don't think there is easy way to cancel running promise :(
@shirshak55 oh! That isn't really what the scope of this PR covers. This only clears the queue of functions waiting to be called, once they're executed there is no stopping them. You might be able to do something clever using a cancelable promise though.
The TS file should be in sync with the readme documentation-wise.
@sindresorhus ah right, sorry about that! I think we should be good to go now 🤞
Closes #18
Issue had been sitting for a little bit, so I decided to try my hand at it. Sorry in advance for any glaring mistakes!