1👍
To use (ack)nowledgements, you have to fire the function.
Client
socket.on('connect', function() {
socket.emit("joinChat", {
chatId: this.chatIdd,
userId: this.userIdd
}, function(confirmation) {
//alert('Work');
console.log(confirmation); // From server
});
}.bind(this));
Server
socket.on('joinChat', (msg, ack) => {
if (msg.chatId) {
socket.join(msg.chatId);
if (typeof ack === 'function') ack('From server')
}
});
- [Vuejs]-V-for loop method to not directly cause rendering
- [Vuejs]-Hide Footer When Keyboard Appear Mobile Web Muse UI
Source:stackexchange.com