packages/@uppy/aws-s3-multipart/src/index.js
function createEventTracker (emitter) {
  const events = []
  return {
    on (event, fn) {
      events.push([ event, fn ])
      return emitter.on(event, fn)
    },
    remove () {
      events.forEach(([ event, fn ]) => {
        emitter.off(event, fn)
      })
    }
  }
}
function createEventTracker (emitter) {
  const events = []
  return {
    on (event, fn) {
      events.push([ event, fn ])
      return emitter.on(event, fn)
    },
    remove () {
      events.forEach(([ event, fn ]) => {
        emitter.off(event, fn)
      })
    }
  }
}
function createEventTracker ( emitter ) { const events = [ ] return { on ( event , fn ) { events . push ( [ event , fn ] ) return emitter . on ( event , fn ) } , remove ( ) { events . forEach ( ( [ event , fn ] ) => { emitter . off ( event , fn ) } ) } } }
Create a wrapper around an event emitter with a `remove` method to remove
all events that were added using the wrapped emitter.
Create a wrapper around an event emitter with a remove method to remove all events that were added using the wrapped emitter .