Create an async handler which will either return a value to a supplied
callback, or call the appropriate method on the promise resolve/reject.
Returns
The returned function takes two arguments (err, value).
If the the callback is a function the two arguments will be passed through
to the callback in the same order. If no callback is supplied, the promise
resolve or reject method will be called depending on the existence of an
error value.
Create an async handler which will either return a value to a supplied callback, or call the appropriate method on the promise resolve/reject.
Returns
The returned function takes two arguments (err, value). If the the callback is a function the two arguments will be passed through to the callback in the same order. If no callback is supplied, the promise resolve or reject method will be called depending on the existence of an error value.