I currently have a Python Flask SocketIO application that will be connecting to a Vue app using this socket.io library. The Vue app (currently) will poll the Python application using socket.io on a button press. I can correctly receive the data sent from Vue; however, Vue is not receiving the data. Currently, my actions/mutations looks like this:
const actions = {
fbCommentsPerPost: (context) => {
console.log('fb comments per post sent!')
socket.emit('fb comments per post', { post_id: '123' })
// socket.on('data', function (resp) {
// console.log(resp)
// })
},
socket_connectResp: (context, message) => {
console.log(message)
},
socket_fbData: (context, message) => {
console.log(message)
}
}
// mutations
const mutations = {
SOCKET_FB_DATA: (state, status) => {
console.log('comments!!!!')
}
}
Using the README for this project, the socket_fbData
should be receiving the data from the Python app (the backend is emitting 'fb data'). When I run a simple client in node using socket.io-client
, this works and I can properly receive data. Moreover, when I uncomment the socket.on block in fbCommentsPerPost
, I can at least console log the data. Is there something I'm missing here?