18.01.2022, 08:58
There are two events that you can use:
Code:
$(localbus).on('connect', function() {
console.log('connected');
});
$(localbus).on('disconnect', function() {
console.log('disconnected');
});