Don't explicitly import Event to address Pouchdb's eventemitter limits
This commit is contained in:
parent
cec16bc536
commit
1fd4e1b6a8
@ -6,10 +6,6 @@ import { router } from './services/router.js';
|
|||||||
import { streamConfig } from './utils/event.js';
|
import { streamConfig } from './utils/event.js';
|
||||||
import { log } from './services/console.js';
|
import { log } from './services/console.js';
|
||||||
|
|
||||||
import { EventEmitter } from 'events';
|
|
||||||
|
|
||||||
EventEmitter.defaultMaxListeners = 1000; // https://github.com/pouchdb/pouchdb/issues/6123
|
|
||||||
|
|
||||||
config({ stream: streamConfig });
|
config({ stream: streamConfig });
|
||||||
|
|
||||||
function go() {
|
function go() {
|
||||||
|
|||||||
@ -93,6 +93,7 @@ export function PouchORM(PouchDB) {
|
|||||||
PouchDB.registerType = (name, cls, db) => {
|
PouchDB.registerType = (name, cls, db) => {
|
||||||
const prefix = name.toLowerCase();
|
const prefix = name.toLowerCase();
|
||||||
const _db = db || PouchDB(prefix);
|
const _db = db || PouchDB(prefix);
|
||||||
|
_db.setMaxListeners(1000);
|
||||||
const _baseSelector = Object.freeze({
|
const _baseSelector = Object.freeze({
|
||||||
_id: { $gt: `${prefix}_0`, $lt: `${prefix}_\ufff0` }
|
_id: { $gt: `${prefix}_0`, $lt: `${prefix}_\ufff0` }
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user