Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Replaced for..of with Array.prototype.forEach. See: ckeditor/ckeditor…
Browse files Browse the repository at this point in the history
  • Loading branch information
Kamil Piechaczek committed Jan 23, 2019
1 parent e1e097c commit 3dc7156
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/emittermixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,15 +237,17 @@ const EmitterMixin = {
this._delegations = new Map();
}

for ( const eventName of events ) {
// Originally there was a for..of loop which unfortunately caused an error in Babel that didn't allow
// build an application. See: https://github.com/ckeditor/ckeditor5-react/issues/40.
events.forEach( eventName => {
const destinations = this._delegations.get( eventName );

if ( !destinations ) {
this._delegations.set( eventName, new Map( [ [ emitter, nameOrFunction ] ] ) );
} else {
destinations.set( emitter, nameOrFunction );
}
}
} );
}
};
},
Expand Down

0 comments on commit 3dc7156

Please sign in to comment.