Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
`${config.remote}/${dbname}`,
config.options
);
return this._dbs[dbname];
}
// Init DB
this._dbs[dbname] = new PouchDB(dbname, config.options);
// Populate state with data
this._dbs[dbname].allDocs(config.allDocs).then((data) => {
return Vue.set(this._state, dbname, data.rows.map((row) => row.doc));
});
// Sync DB
PouchDB.sync(
dbname,
`${config.remote}/${dbname}`,
config.sync
);
// Start detecting changes
this._initChanges(dbname, config);
// Return instance
return this._dbs[dbname];
}
var options = Object.assign({
ajax: { cache: false }
}, opts);
if (opts.remoteOnly) {
this$1.databases[dbname] = new PouchDB(
((config.remote) + "/" + dbname),
options
);
return this$1.databases[dbname];
}
this$1.databases[dbname] = new PouchDB(dbname, options);
PouchDB.sync(
dbname,
((config.remote) + "/" + dbname),
config.sync
);
return this$1.databases[dbname];
};