How to use the eventemitter3.EventEmitter.call function in eventemitter3

To help you get started, we’ve selected a few eventemitter3 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mpangrazzi / html5-uploader / lib / index.js View on Github external
if (options.headers && typeof options.headers !== 'object') {
    throw new TypeError('options `headers` must be an object');
  }

  //

  this.files = [];
  this.method = options.method || 'POST';
  this.name = options.name || 'file';
  this.url = options.url || null;
  this.headers = options.headers || {};

  // EE3

  EE3.call(this);

  // error listener

  this.on('error', this._onError.bind(this));

  // check support

  this._checkSupport();

  // attach to $el

  this._attach();

}
util.inherits(Uploader, EE3);
github openstf / stf / lib / util / riskystream.js View on Github external
function RiskyStream(stream) {
  EventEmitter.call(this)

  this.endListener = function() {
    this.ended = true
    this.stream.removeListener('end', this.endListener)

    if (!this.expectingEnd) {
      this.emit('unexpectedEnd')
    }

    this.emit('end')
  }.bind(this)

  this.stream = stream
    .on('end', this.endListener)
  this.expectingEnd = false
  this.ended = false
github openstf / stf / lib / units / device / plugins / touch / index.js View on Github external
function TouchConsumer(config) {
      EventEmitter.call(this)
      this.actionQueue = []
      this.runningState = TouchConsumer.STATE_STOPPED
      this.desiredState = new StateQueue()
      this.output = null
      this.socket = null
      this.banner = null
      this.touchConfig = config
      this.starter = Promise.resolve(true)
      this.failCounter = new FailCounter(3, 10000)
      this.failCounter.on('exceedLimit', this._failLimitExceeded.bind(this))
      this.failed = false
      this.readableListener = this._readableListener.bind(this)
      this.writeQueue = []
    }
github ctubio / Krypto-trading-bot / src / server / gateways / coinbase-api.ts View on Github external
export var OrderBook = function(productID: string, websocketURI: string, restURI: string, timeProvider: Utils.ITimeProvider) {
    var self = this;
    EventEmitter.call(self);

    self.productID = productID || 'BTC-USD';
    self.websocketURI = websocketURI || 'wss://ws-feed.exchange.coinbase.com';
    self.restURI = restURI;
    self.state = self.STATES.closed;
    self.fail_count = 0;
    self.timeProvider = timeProvider;
    self.connect();
};
github GrimoireGL / GrimoireJS / src / Base / EEObject.ts View on Github external
constructor() {
    super();
    EventEmitter.call(this);
  }
}
github http-party / node-http-proxy / lib / http-proxy / index.js View on Github external
function ProxyServer(options) {
  EE3.call(this);

  this.web     = createRightProxy('web')(options);
  this.ws      = createRightProxy('ws')(options);
  this.options = options;

  this.webPasses = Object.keys(web).map(function(pass) {
    return web[pass];
  });

  this.wsPasses = Object.keys(ws).map(function(pass) {
    return ws[pass];
  });
}
github openstf / stf / lib / wire / router.js View on Github external
function Router() {
  if (!(this instanceof Router)) {
    return new Router()
  }

  EventEmitter.call(this)
}

eventemitter3

EventEmitter3 focuses on performance while maintaining a Node.js AND browser compatible interface.

MIT
Latest version published 2 years ago

Package Health Score

76 / 100
Full package analysis