My app has a use case to clear all MQTT client on logout and re-create the client when login again.
But when removeClient the check if(this.clients.length > 0) always return false, therefore it won't remove the eventHandler resulting when I create new client it could not set up MQTT events again.
Context
My app has a use case to clear all MQTT client on logout and re-create the client when login again.
But when removeClient the check
if(this.clients.length > 0)
always return false, therefore it won't remove theeventHandler
resulting when I create new client it could not set up MQTT events again.