module.exports = function () {
  let emitter = {
    events: { }
  }

  emitter.emit = (event, ...args) => {
    (emitter.events[event] || []).filter(i => i(...args))
  }

  emitter.on = (event, cb) => {
    (emitter.events[event] = emitter.events[event] || []).push(cb)
    return function () {
      emitter.events[event] = emitter.events[event].filter(i => i !== cb)
    }
  }

  return emitter
}

module.exports = function () {
  return {
    events: {},
    emit (event, ...args) {
      (this.events[event] || []).filter(i => i(...args))
    },
    on (event, cb) {
      (this.events[event] = this.events[event] || []).push(cb)
      return () => (
        this.events[event] = this.events[event].filter(i => i !== cb)
      )
    }
  }
}

Reduce size to 69 (#30)