MCPcopy
hub / github.com/cujojs/when / liftCallback

Function liftCallback

node.js:272–276  ·  view source on GitHub ↗

* Takes a node-style callback and returns new function that accepts a * promise, calling the original callback when the promise is either * fulfilled or rejected with the appropriate arguments. * * @example * var deferred = when.defer(); * * function callback(err, value) { * // Hand

(callback)

Source from the content-addressed store, hash-verified

270 * @returns {Function} The lifted, promise-accepting function.
271 */
272 function liftCallback(callback) {
273 return function(promise) {
274 return bindCallback(promise, callback);
275 };
276 }
277});
278
279})(typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(require); });

Callers

nothing calls this directly

Calls 1

bindCallbackFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…