Feature: added addEventListener/removeEventListener API on top of our events `onDone` and `onDoneBefore`; when you do *not* set them in the classic way, e.g. through code like
Feature: added addEventListener/removeEventListener API on top of our events `onDone` and `onDoneBefore`; when you do *not* set them in the classic way, e.g. through code like

```
NProgress.settings.onDone = function () { bla }
```

but instead *register* your event handlers like this:

```
NProgress.settings.onDone.addEventListener(function () { bla })
```

then you get all the benefits of the new API:

- `{event}.addEventListener`: Add a callback/listener to the event; a la the DOM addEventListener, duplicate registrations are skipped.

- `{event}.removeEventListener`: Remove the targeted listener (if it is still present in the event listener set); when no parameter or a non-function-type parameter is passed, it means *all* listeners will be removed at once.

A generator function, which produces a function/object which offers these methods, is accessible through `NProgress.Internals.generateFunctionRegister`. Example (pseudo)code:

```
// create new instance of event registrar
var evtIF = NProgress.Internals.generateFunctionRegister();
...
// register callback(s):
evtIF.addEventListener(a);
evtIF.addEventListener(b);
...
// 'fire' the 'event': this will invoke registered callbacks `a` and `b`, where each will receive the `args` passed into evtIF:
evtIF(args);
```

GerHobbelt/nprogress,GerHobbelt/nprogress,GerHobbelt/nprogress