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

Commit 900b54b

Browse files
authored
Merge pull request #271 from ckeditor/t/ckeditor5-react/40
Other: Replaced `for..of` statement in `EventEmitter` with `Array.prototype.forEach`. This changes allows building a React application using `create-react-app@2`. Closes ckeditor/ckeditor5-react#40.
2 parents e1e097c + 3dc7156 commit 900b54b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/emittermixin.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,15 +237,17 @@ const EmitterMixin = {
237237
this._delegations = new Map();
238238
}
239239

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

243245
if ( !destinations ) {
244246
this._delegations.set( eventName, new Map( [ [ emitter, nameOrFunction ] ] ) );
245247
} else {
246248
destinations.set( emitter, nameOrFunction );
247249
}
248-
}
250+
} );
249251
}
250252
};
251253
},

0 commit comments

Comments
 (0)