Remove listeners after start/stop.

This commit is contained in:
Julien Fontanet
2016-01-12 18:57:02 +01:00
parent 3db0dda67a
commit 879f9b4ea9

View File

@@ -169,8 +169,10 @@ export default class Xo extends EventEmitter {
resolve(listener.call(this))
}).catch(noop)
))
this.removeAllListeners('start')
this.emit('started')
this.removeAllListeners('started')
}
// -----------------------------------------------------------------
@@ -187,8 +189,10 @@ export default class Xo extends EventEmitter {
resolve(listener.call(this))
}).catch(noop)
))
this.removeAllListeners('stop')
this.emit('stopped')
this.removeAllListeners('stopped')
}
// -----------------------------------------------------------------