Skip to content

Instantly share code, notes, and snippets.

@sanjayabc1234
Forked from oleh-zaporozhets/MyEventEmitter.On.js
Created October 14, 2020 16:39
Show Gist options
  • Save sanjayabc1234/e507dd05ec392e4d44aacc8d841ded16 to your computer and use it in GitHub Desktop.
Save sanjayabc1234/e507dd05ec392e4d44aacc8d841ded16 to your computer and use it in GitHub Desktop.
on(name, listener) {
if (!this._events[name]) {
this._events[name] = [];
}
this._events[name].push(listener);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment