MCPcopy
hub / github.com/apache/pouchdb / adapterFun

Function adapterFun

lib/index.es.js:162–185  ·  view source on GitHub ↗
(name, callback)

Source from the content-addressed store, hash-verified

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

Callers 4

_setupMethod · 0.70
index.es.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…