MCPcopy Index your code
hub / github.com/apache/pouchdb / adapterFun

Function adapterFun

lib/index.js:167–190  ·  view source on GitHub ↗
(name, callback)

Source from the content-addressed store, hash-verified

165}
166
167function adapterFun(name, callback) {
168 return toPromise(function (...args) {
169 if (this._closed) {
170 return Promise.reject(new Error('database is closed'));
171 }
172 if (this._destroyed) {
173 return Promise.reject(new Error('database is destroyed'));
174 }
175 var self = this;
176 logApiCall(self, name, args);
177 if (!this.taskqueue.isReady) {
178 return new Promise(function (fulfill, reject) {
179 self.taskqueue.addTask(function (failed) {
180 if (failed) {
181 reject(failed);
182 } else {
183 fulfill(self[name].apply(self, args));
184 }
185 });
186 });
187 }
188 return callback.apply(this, args);
189 });
190}
191
192// like underscore/lodash _.pick()
193function pick(obj, arr) {

Callers 4

_setupMethod · 0.70
index.jsFile · 0.70
adapterFun$$1Function · 0.70
HttpPouchFunction · 0.70

Calls 3

toPromiseFunction · 0.70
logApiCallFunction · 0.70
addTaskMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…