src/index.js
function first (callback) {
        if (typeof callback !== 'function') {
          throw new Error('Callback must be a function, instead got: ' + (typeof callback));
        }

        function firstCallback (result) {
          callback(result);
          unbind('start', firstCallback);
        }

        bind('start', firstCallback);
        bind('stop', unbind.bind(null, 'end', firstCallback));

        return self;
      }
function first (callback) {
        if (typeof callback !== 'function') {
          throw new Error('Callback must be a function, instead got: ' + (typeof callback));
        }

        function firstCallback (result) {
          callback(result);
          unbind('start', firstCallback);
        }

        bind('start', firstCallback);
        bind('stop', unbind.bind(null, 'end', firstCallback));

        return self;
      }
function first ( callback ) { if ( typeof callback !== 'function' ) { throw new Error ( 'Callback must be a function, instead got: ' + ( typeof callback ) ) ; } function firstCallback ( result ) { callback ( result ) ; unbind ( 'start' , firstCallback ) ; } bind ( 'start' , firstCallback ) ; bind ( 'stop' , unbind . bind ( null , 'end' , firstCallback ) ) ; return self ; }
Run on start and automatically unbind
Run on start and automatically unbind