How to use the event-emitter.alloff function in event-emitter

To help you get started, we’ve selected a few event-emitter 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 konforti / GSVPano / src / Pano.js View on Github external
Pano.prototype.composeFromTile = function(x, y, texture) {
  // Complete this section of the frame
  this._ctx.drawImage(texture, x * 512, y * 512);
  this._count++;

  var p = Math.round(this._count * 100 / this._total);
  this.emit('progress', p);

  // If finished
  if (this._count === this._total) {
    // Done loading
    this._loaded = true;
    // Trigger complete event
    this.emit('complete', this);
    // Remove all events
    eventEmitter.alloff(this);
  }
};