use an event emitter
Detach event listener on disconnect