Merge pull request #826 from vibertthio/fix-variable-name

fix the wrong variable name 'event' in Emitter.ts
This commit is contained in:
Yotam Mann 2021-01-25 10:29:02 -05:00 committed by GitHub
commit 09dd41f46a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -69,11 +69,11 @@ export class Emitter<EventType extends string = string> extends Tone {
if (isUndef(this._events)) {
this._events = {};
}
if (this._events.hasOwnProperty(event)) {
if (this._events.hasOwnProperty(eventName)) {
if (isUndef(callback)) {
this._events[event] = [];
this._events[eventName] = [];
} else {
const eventList = this._events[event];
const eventList = this._events[eventName];
for (let i = eventList.length - 1; i >= 0; i--) {
if (eventList[i] === callback) {
eventList.splice(i, 1);