How to use the event-emitter.prototype 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 hackhat / fluxmax / examples / readme / src / stores / BaseStore.js View on Github external
var FluxmaxStoreMixin = require('fluxmax').StoreMixin;
var EventEmitter      = require('event-emitter');





var BaseStore = function(){

};





_.extend(BaseStore.prototype, EventEmitter.prototype, FluxmaxStoreMixin, {

});





module.exports = BaseStore;
github lance-gg / spaaace / src / client / MobileControls.js View on Github external
constructor(clientEngine){
        Object.assign(this, EventEmitter.prototype);
        this.clientEngine = clientEngine;
        this.renderer = clientEngine.renderer;

        this.touchContainer = document.querySelector('.pixiContainer');
        this.setupListeners();

        this.activeInput = {
            up: false,
            left: false,
            right: false
        };

        let onRequestAnimationFrame = () => {
            this.handleMovementInput();
            window.requestAnimationFrame(onRequestAnimationFrame);
        };