3 ms·
> [promisification is] something that works most of the time, but sometimes breaks when the callback code isn't what the promisify function expected You're jus
by callumlocke 10y ago
> [promisification is] something that works most of the time, but sometimes breaks when the callback code isn't what the promisify function expected
You're just saying that if you make a mistake and use it wrong it doesn't work. That applies to all code, not just promisify.
> Also, the library writers are not writing the code with any guarantees that promisify will always work. So even if it works now, it could break in the future.
That also applies to all code, not just promisify. If the author changes their API without a major version bump, that can break any code that relied on the old API.
Promisify is deterministic and works as specified, 100% of the time. If it doesn't work, that means you passed a function with the wrong signature.