HenrikJoreteg / wildemitter

A super lightweight EventEmitter similar to what comes in Node.js, but with a support for wildcard events '*'
MIT License
213 stars 21 forks source link

Add fix for removing listener during emit #7

Closed johannilsson closed 10 years ago

johannilsson commented 10 years ago

This fixes an issue that occurred when an event had multiple listeners attached and one listener was removed while emiting. This caused an issue for once which only allowed one listener to be active at the time.

johannilsson commented 10 years ago

Made a copy of the listeners before iterating in emit using slice.

Needed this when porting a Browserify build from nodes EventEmitter to WildEmitter.

Thanks for a great module!

HenrikJoreteg commented 10 years ago

Thank you @johannilsson !