lib/operations/db_ops.js
function createListener(db, e, object) {
  function listener(err) {
    if (object.listeners(e).length > 0) {
      object.emit(e, err, db);

      // Emit on all associated db's if available
      for (let i = 0; i < db.s.children.length; i++) {
        db.s.children[i].emit(e, err, db.s.children[i]);
      }
    }
  }
  return listener;
}
function createListener(db, e, object) {
  function listener(err) {
    if (object.listeners(e).length > 0) {
      object.emit(e, err, db);

      // Emit on all associated db's if available
      for (let i = 0; i < db.s.children.length; i++) {
        db.s.children[i].emit(e, err, db.s.children[i]);
      }
    }
  }
  return listener;
}
function createListener ( db , e , object ) { function listener ( err ) { if ( object . listeners ( e ) . length > 0 ) { object . emit ( e , err , db ) ; // Emit on all associated db's if available for ( let i = 0 ; i < db . s . children . length ; i ++ ) { db . s . children [ i ] . emit ( e , err , db . s . children [ i ] ) ; } } } return listener ; }
Add listeners to topology
Add listeners to topology