Closed dobesv closed 5 years ago
Yes, this was an oversight on my part. Thank you for fixing it 👍
I applied your change to the EJS file bottleneck.d.ts.ejs
as it generates the bottleneck.d.ts.ejs
file. I also added a few typings tests in test.ts
and finally allowed users to return null
(sync and async). https://github.com/SGrondin/bottleneck/commit/712db2f736fd243bf262760e053714acb5535ead
It's been released in v2.19.1 🎉 https://github.com/SGrondin/bottleneck/releases/tag/v2.19.1
Thank you for your contribution!
The type for the
failed
event only allowed you to return aPromise<number>
orvoid
. However, you might want to return anumber
synchronously, or returnvoid
asynchronously. This change allows those other cases in thefailed
event handler.