index.js
function attachListener (msg, listener) {
  var attached = msg.__onFinished

  // create a private single listener with queue
  if (!attached || !attached.queue) {
    attached = msg.__onFinished = createListener(msg)
    attachFinishedListener(msg, attached)
  }

  attached.queue.push(listener)
}
function attachListener (msg, listener) {
  var attached = msg.__onFinished

  // create a private single listener with queue
  if (!attached || !attached.queue) {
    attached = msg.__onFinished = createListener(msg)
    attachFinishedListener(msg, attached)
  }

  attached.queue.push(listener)
}
function attachListener ( msg , listener ) { var attached = msg . __onFinished // create a private single listener with queue if ( ! attached || ! attached . queue ) { attached = msg . __onFinished = createListener ( msg ) attachFinishedListener ( msg , attached ) } attached . queue . push ( listener ) }
Attach the listener to the message.

@param {object} msg
@return {function}
@private
Attach the listener to the message .