How to use the eventemitter3.EventEmitter.prototype 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 RobotlegsJS / RobotlegsJS-Pixi / src / robotlegs / bender / extensions / contextView / pixiPatch / eventemitter3-patch.ts View on Github external
},

    dispatchEvent(event: IEvent): void {
        event.target = this;

        let currentTarget = this;
        do {
            event.currentTarget = currentTarget;
            event.currentTarget.emit(event.type, event);
            currentTarget = currentTarget.parent;
        } while (currentTarget && event.bubbles);
    }
};

Object.assign(DisplayObject.prototype, EventDispatcherMixin);
Object.assign(EventEmitter.prototype, EventDispatcherMixin);
github openstf / stf / lib / wire / router.js View on Github external
Router.prototype.removeListener = function(message, handler) {
  return EventEmitter.prototype.removeListener.call(
    this
  , message.$code
  , handler
  )
}
github openstf / stf / lib / wire / router.js View on Github external
var EventEmitter = require('eventemitter3').EventEmitter
var util = require('util')

var wire = require('./')
var log = require('../util/logger').createLogger('wire:router')
var on = EventEmitter.prototype.on

function Router() {
  if (!(this instanceof Router)) {
    return new Router()
  }

  EventEmitter.call(this)
}

util.inherits(Router, EventEmitter)

Router.prototype.on = function(message, handler) {
  return on.call(this, message.$code, handler)
}

Router.prototype.removeListener = function(message, handler) {

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