emitter.js
function( type, handler ) {

      if( handler === void 0 || handler === null )
        throw new Error( 'Missing argument "handler"' )

      if( typeof handler !== 'function' && typeof handler.handleEvent !== 'function' )
        throw new TypeError( 'Handler must be a function.' )

      function wrapper() {
        this.removeListener( type, wrapper )
        typeof handler !== 'function'
          ? handler.handleEvent.apply( handler, arguments )
          : handler.apply( this, arguments )
      }

      this._events[ type ] ?
        this._events[ type ].push( wrapper ) :
        this._events[ type ] = [ wrapper ]

      return this

    }
function( type, handler ) {

      if( handler === void 0 || handler === null )
        throw new Error( 'Missing argument "handler"' )

      if( typeof handler !== 'function' && typeof handler.handleEvent !== 'function' )
        throw new TypeError( 'Handler must be a function.' )

      function wrapper() {
        this.removeListener( type, wrapper )
        typeof handler !== 'function'
          ? handler.handleEvent.apply( handler, arguments )
          : handler.apply( this, arguments )
      }

      this._events[ type ] ?
        this._events[ type ].push( wrapper ) :
        this._events[ type ] = [ wrapper ]

      return this

    }
function ( type , handler ) { if ( handler === void 0 || handler === null ) throw new Error ( 'Missing argument "handler"' ) if ( typeof handler !== 'function' && typeof handler . handleEvent !== 'function' ) throw new TypeError ( 'Handler must be a function.' ) function wrapper ( ) { this . removeListener ( type , wrapper ) typeof handler !== 'function' ? handler . handleEvent . apply ( handler , arguments ) : handler . apply ( this , arguments ) } this . _events [ type ] ? this . _events [ type ] . push ( wrapper ) : this . _events [ type ] = [ wrapper ] return this }
Adds a one time listener for the specified event
@param  {String}   type
@param  {Function} handler
@return {Emitter}
Adds a one time listener for the specified event