This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class EventBusClass { | |
constructor() { | |
this.listeners = new Map() //For a better performance instead object {} | |
} | |
addEventListener(type, callback, scope, ...args) { | |
var arr_listener = this.listeners.get(type); //[...Array] | |
if (!arr_listener) | |
return this.listeners.set(type, [{scope, callback, args}] ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* GenericWebWorker v2.3 | |
* | |
* A Generic Javascript WebWorker that allows the user to execute and pass functions | |
* Is Fileless, for what the user does not need a file.js to request | |
* | |
* @author, Edgar Fernando Carvajal Ulloa <[email protected]>, <[email protected]> | |
* {@link https://github.com/fercarvo/GenericWebWorker} | |
*/ | |
class GenericWebWorker { |