code: function addListeners(server, map) {
    for (const event of Object.keys(map)) server.on(event, map[event]);
  
    return function removeListeners() {
      for (const event of Object.keys(map)) {
        server.removeListener(event, map[event]);
      }
    };
  }
docs: Add event listeners on an `EventEmitter` using a map of <event, listener>
  pairs.
  
  @param {EventEmitter} server The event emitter
  @param {Object.<String, Function>} map The listeners to add
  @return {Function} A function that will remove the added listeners when called
  @private