How to use the eventemitter3.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 olebedev / swarm / swarm-bat / src / BatMux.js View on Github external
function BatMux (options) {
    EventEmitter.call(this);
    if (!options) {
        options = {};
    } else if (options.constructor===String) {
        options = {server_url: options};
    }
    this.options = options;
    if ('server_url' in options) { options.connect = options.server_url; }
    this.trunk = new BatStream();
    this.branches = {};
    this.data = [];
    this.chop = '';
    this.url_r = '';
    this.active_tag_w = '';
    this.end = false;
    this.accept_count = 0;
    this.trunk.pair.on('data', this.onTrunkDataIn.bind(this));
github node-lifx / lifx-lan-client / src / lifx / client.js View on Github external
function Client() {
  EventEmitter.call(this);

  this.debug = false;
  this.socket = dgram.createSocket('udp4');
  this.isSocketBound = false;
  this.devices = {};
  this.port = null;
  this.messageQueues = {};
  this.sendTimers = {};
  this.discoveryTimer = null;
  this.discoveryPacketSequence = 0;
  this.messageHandlers = [{
    type: 'stateService',
    callback: this.processDiscoveryPacket.bind(this)
  }, {
    type: 'stateLabel',
    callback: this.processLabelPacket.bind(this)
github slackapi / node-slack-sdk / lib / clients / client.js View on Github external
function BaseAPIClient(token, opts) {
  var clientOpts = opts || {};
  EventEmitter.call(this);

  /**
   * @type {string}
   * @private
   */
  this._token = token;

  /** @type {string} */
  this.slackAPIUrl = clientOpts.slackAPIUrl || 'https://slack.com/api/';

  /**
   * The logger function attached to this client.
   * @type {BaseAPIClient~logFn}
   */
  this.logger = clientOpts.logger || globalHelpers.getLogger(clientOpts.logLevel);
github photonstorm / phaser / plugins / fbinstant / src / Leaderboard.js View on Github external
function Leaderboard (plugin, data)
    {
        EventEmitter.call(this);

        /**
         * A reference to the Facebook Instant Games Plugin.
         *
         * @name Phaser.FacebookInstantGamesLeaderboard#plugin
         * @type {Phaser.FacebookInstantGamesPlugin}
         * @since 3.13.0
         */
        this.plugin = plugin;

        /**
         * An Instant Game leaderboard instance.
         *
         * @name Phaser.FacebookInstantGamesLeaderboard#ref
         * @type {any}
         * @since 3.13.0
github horpto / nodecap2 / src / icap_request.js View on Github external
constructor(id) {
    super();
    EventEmitter.call(this);

    this.id = id;
    this.stream = null;
    this.preview = null;
    this.ieof = false;
    this.done = false;
  }
github omniscientjs / immstruct / src / structure.js View on Github external
function Structure (options) {
  var self = this;

  options = options || {};
  if (!(this instanceof Structure)) {
    return new Structure(options);
  }

  EventEmitter.call(this, arguments);

  this.key = options.key || utils.generateRandomKey();

  this._queuedChange = false;
  this.current = options.data;
  if (!isImmutableStructure(this.current) || !this.current) {
    this.current = Immutable.fromJS(this.current || {});
  }

  if (!!options.history) {
    this.history = Immutable.List.of(this.current);
    this._currentRevision = 0;
    this._historyLimit = (typeof options.historyLimit === 'number') ?
      options.historyLimit :
      Infinity;
  }
github photonstorm / phaser / src / scale / ScaleManager.js View on Github external
function ScaleManager (game)
    {
        EventEmitter.call(this);

        /**
         * A reference to the Phaser.Game instance.
         *
         * @name Phaser.Scale.ScaleManager#game
         * @type {Phaser.Game}
         * @readonly
         * @since 3.15.0
         */
        this.game = game;

        /**
         * A reference to the HTML Canvas Element that Phaser uses to render the game.
         *
         * @name Phaser.Scale.ScaleManager#canvas
         * @type {HTMLCanvasElement}
github PhaserEditor2D / PhaserEditor / source / v2 / phasereditor / phasereditor.resources.phaser.code / phaser-master / src / input / gamepad / Gamepad.js View on Github external
function Gamepad (manager, pad)
    {
        EventEmitter.call(this);

        /**
         * A reference to the Gamepad Plugin.
         *
         * @name Phaser.Input.Gamepad.Gamepad#manager
         * @type {Phaser.Input.Gamepad.GamepadPlugin}
         * @since 3.0.0
         */
        this.manager = manager;

        /**
         * A reference to the native Gamepad object that is connected to the browser.
         *
         * @name Phaser.Input.Gamepad.Gamepad#pad
         * @type {any}
         * @since 3.10.0
github photonstorm / phaser / src / animations / Animation.js View on Github external
function Animation (manager, key, config)
    {
        EventEmitter.call(this);

        /**
         * A reference to the global Animation Manager.
         *
         * @name Phaser.Animations.Animation#manager
         * @type {Phaser.Animations.AnimationManager}
         * @since 3.0.0
         */
        this.manager = manager;

        /**
         * The unique identifying string for this animation.
         *
         * @name Phaser.Animations.Animation#key
         * @type {string}
         * @since 3.0.0
github GreyRook / gown.js / src / interaction / ResizeManager.js View on Github external
function ResizeManager(renderer, options) {
    EventEmitter.call(this);

    options = options || {};

    /**
     * The renderer this interaction manager works for.
     *
     * @type PIXI.SystemRenderer
     */
    this.renderer = renderer;

    /**
     * Should default browser actions automatically be prevented.
     *
     * @type bool
     * @default true
     */

eventemitter3

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

MIT
Latest version published 1 year ago

Package Health Score

79 / 100
Full package analysis