mongodb-js / hadron-plugin-manager

Simple plugin manager for composable Hadron applications.
Apache License 2.0
0 stars 0 forks source link

Call packageActivationCompleted only once at the end #1

Closed rueckstiess closed 8 years ago

rueckstiess commented 8 years ago

The reflux actions used here were asynchronous by default, and their execution was deferred until after all packages were loaded. Inside _completeActivation() the condition this._isReadingComplete() was therefore always true, so the packageActivationCompleted() triggered once for each package loaded. Making the actions synchronous fixes this problem.

Also, after loading is complete, the listeners need to be unregistered again. Otherwise there are issues when multiple managers are being used at once.

Tests included.

mention-bot commented 8 years ago

@rueckstiess, thanks for your PR! By analyzing the annotation information on this pull request, we identified @durran to be a potential reviewer