Can i use returning promise in socket.io "socket.on"? Like the following code.
socket.on('news', function (data) {
return News.findOne({id: data.id})
.then((news) => {
socket.emit('event', data.body);
return news;
})
});
via ashnamuh
No comments:
Post a Comment