index.js
function Strategy(transports, options) {
  var strategy = this;

  if (!(strategy instanceof Strategy)) return new Strategy(transports, options);
  if (Object.prototype.toString.call(transports) !== '[object Array]') {
    options = transports;
    transports = [];
  }

  strategy.transports = [];     // List of active transports.
  strategy.transport = 0;       // Current selected transport id.
  strategy.length = 0;          // Amount of transports available.
  strategy.id = 0;              // ID generation pool.

  for (var i = 0; i < transports.length; i++) {
    strategy.push(transports[i]);
  }
}
function Strategy(transports, options) {
  var strategy = this;

  if (!(strategy instanceof Strategy)) return new Strategy(transports, options);
  if (Object.prototype.toString.call(transports) !== '[object Array]') {
    options = transports;
    transports = [];
  }

  strategy.transports = [];     // List of active transports.
  strategy.transport = 0;       // Current selected transport id.
  strategy.length = 0;          // Amount of transports available.
  strategy.id = 0;              // ID generation pool.

  for (var i = 0; i < transports.length; i++) {
    strategy.push(transports[i]);
  }
}
function Strategy ( transports , options ) { var strategy = this ; if ( ! ( strategy instanceof Strategy ) ) return new Strategy ( transports , options ) ; if ( Object . prototype . toString . call ( transports ) !== '[object Array]' ) { options = transports ; transports = [ ] ; } strategy . transports = [ ] ; // List of active transports. strategy . transport = 0 ; // Current selected transport id. strategy . length = 0 ; // Amount of transports available. strategy . id = 0 ; // ID generation pool. for ( var i = 0 ; i < transports . length ; i ++ ) { strategy . push ( transports [ i ] ) ; } }
Transport selection strategy.

@constructor
@param {Array} transports Array of transports that should be added.
@param {Object} options Optional configuration.
@api public
Transport selection strategy .