Don't explicitly import Event to address Pouchdb's eventemitter limits

This commit is contained in:
Timothy Farrell 2018-01-07 14:35:22 -06:00
parent db45c55028
commit 0dcb6600fa
2 changed files with 1 additions and 4 deletions

View File

@ -6,10 +6,6 @@ import { router } from './services/router.js';
import { streamConfig } from './utils/event.js';
import { log } from './services/console.js';
import { EventEmitter } from 'events';
EventEmitter.defaultMaxListeners = 1000; // https://github.com/pouchdb/pouchdb/issues/6123
config({ stream: streamConfig });
function go() {

View File

@ -93,6 +93,7 @@ export function PouchORM(PouchDB) {
PouchDB.registerType = (name, cls, db) => {
const prefix = name.toLowerCase();
const _db = db || PouchDB(prefix);
_db.setMaxListeners(1000);
const _baseSelector = Object.freeze({
_id: { $gt: `${prefix}_0`, $lt: `${prefix}_\ufff0` }
});