MCPcopy Create free account
hub / github.com/apache/pouchdb / callbackify

Function callbackify

lib/index.js:7852–7861  ·  view source on GitHub ↗
(fun)

Source from the content-addressed store, hash-verified

7850}
7851
7852function callbackify(fun) {
7853 return function (...args) {
7854 var cb = args.pop();
7855 var promise = fun.apply(this, args);
7856 if (typeof cb === 'function') {
7857 promisedCallback(promise, cb);
7858 }
7859 return promise;
7860 };
7861}
7862
7863// Promise finally util similar to Q.finally
7864function fin(promise, finalPromiseFactory) {

Callers 1

createAbstractMapReduceFunction · 0.70

Calls 1

promisedCallbackFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…