Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
vkjv
on May 18, 2015
|
parent
|
context
|
favorite
| on:
We have a problem with promises
Also, fun is that `.nodeify(cb)` protects against undefined. So, it's a handy way to make your library support both promises
and
callbacks.
module.exports = function (arg, optionalCb) { return promiseReturningFn(arg).nodeify(optionalCb); };
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: