-
Notifications
You must be signed in to change notification settings - Fork 73
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
Not compatible with node.js "once" #164
Comments
dobesv
changed the title
Types not compatible with node.js "once"
Not compatible with node.js "once"
Aug 24, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A handy way to wait for an event with node.js is to use the
once
function in theevents
module.e.g.
await once(bottleneck, 'empty');
to wait for the bottleneckempty
event using promises.However, doing this results in a type error:
This seems to be because
once
is supposed to return the event emitter itself but in Bottleneck is declared as returningvoid
.Also, even if I ignore the type error,
once
still never resolves because Bottleneck doesn't fully implement the expectedEventEmitter
protocol. I wonder if it would make sense to check if there's a nativeEventEmitter
available in the environment somehow and use that if it is there.The text was updated successfully, but these errors were encountered: