Wrap requests in promises when callback is not set
kibertoad opened this issue · 2 comments
kibertoad commented
This is a common pattern for libraries that support both callback-based and promise-based APIs. Current promisify-based approach does not provide proper typings.
rudolfbyker commented
Alternative idea: Get rid of callbacks entirely, and write nice async functions. It's easier/cleaner to wrap an async function to make it work with callbacks than the other way around.
kibertoad commented
Checked how undici does it, and yeah, it seems to have dropped callbacks as well.
Sure, let's do that then.
Let's combine move to async with move to axios or superagent then (request doesn't support promises and is deprecated anyway)