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

Allow failed event handler to return Promise<void> or number #126

Merged
merged 1 commit into from
Jun 8, 2019

Conversation

dobesv
Copy link
Contributor

@dobesv dobesv commented Jun 7, 2019

The type for the failed event only allowed you to return a Promise<number> or void. However, you might want to return a number synchronously, or return void asynchronously. This change allows those other cases in the failed event handler.

The type for the `failed` event only allowed you to return a `Promise<number>` or `void`.  However, you might want to return a `number` synchronously, or return `void` asynchronously.  This change allows those other cases in the `failed` event handler.
@SGrondin SGrondin merged commit 3166fec into SGrondin:master Jun 8, 2019
@SGrondin
Copy link
Owner

SGrondin commented Jun 8, 2019

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). 712db2f

It's been released in v2.19.1 🎉 https://github.com/SGrondin/bottleneck/releases/tag/v2.19.1

Thank you for your contribution!

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 this pull request may close these issues.

2 participants